This commit is contained in:
2025-06-26 04:42:51 +00:00
parent be418b1f32
commit 78212cc2a9
183 changed files with 41796 additions and 0 deletions

16
reader/src/api.js Normal file
View 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" },
});

View File

@@ -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,

View File

@@ -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);