mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-23 10:07:30 +02:00
Change environment variables strategy
This commit is contained in:
12
src/utils/config.util.ts
Normal file
12
src/utils/config.util.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import axios from "axios";
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
export const ConfigContext = createContext<any>({});
|
||||
|
||||
export const useConfig = () => useContext(ConfigContext);
|
||||
|
||||
const getGonfig = async() => {
|
||||
return (await axios.get("/api/config")).data;
|
||||
};
|
||||
|
||||
export default { getGonfig };
|
||||
Reference in New Issue
Block a user