Files
swiss-datashare/src/utils/config.util.ts
2022-05-02 08:22:53 +02:00

13 lines
305 B
TypeScript

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 };