update
This commit is contained in:
16
reader/src/api.js
Normal file
16
reader/src/api.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import axios from "axios";
|
||||
|
||||
const API_BASE_URL = "https://api.med.tomastm.com";
|
||||
const RESOURCES_BASE_URL = "https://resources.med.tomastm.com";
|
||||
|
||||
export const apiInstance = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 1000,
|
||||
headers: { Origin: "https://med.tomastm.com" },
|
||||
});
|
||||
|
||||
export const resourcesInstance = axios.create({
|
||||
baseURL: RESOURCES_BASE_URL,
|
||||
timeout: 1000,
|
||||
headers: { Origin: "https://med.tomastm.com" },
|
||||
});
|
||||
@@ -5,6 +5,7 @@ import { createRoot } from "react-dom/client";
|
||||
import { useParams, Navigate, BrowserRouter, Link, Outlet, Route, Routes } from "react-router";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
import { marked } from "marked";
|
||||
import { apiInstance, resourcesInstance } from "./api.js";
|
||||
import { useStore } from "./store.js";
|
||||
import {
|
||||
ArrowBackIcon,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { create } from "zustand";
|
||||
import { apiInstance } from "./api.js";
|
||||
import structure from "./topics.json";
|
||||
|
||||
const localSubject = (() => {
|
||||
@@ -58,3 +59,9 @@ function getLocalConfig() {
|
||||
|
||||
return { ...defaultConfig, ...config };
|
||||
}
|
||||
|
||||
async function getStructure() {
|
||||
const res = await apiInstance.get("/structure");
|
||||
console.log(res);
|
||||
}
|
||||
getStructure().catch(console.error);
|
||||
|
||||
Reference in New Issue
Block a user