frontend redesign

This commit is contained in:
ngn
2025-01-07 00:13:11 +03:00
parent 337e56de78
commit fc11748e57
37 changed files with 1545 additions and 900 deletions

21
app/src/lib/api.js Normal file
View File

@ -0,0 +1,21 @@
const version = "v1";
const url = new URL(version + "/", import.meta.env.VITE_API_URL).href;
function join(path) {
if (null === path || path === "") return url;
if (path[0] === "/") path = path.slice(1);
return new URL(path, url).href;
}
async function services(fetch) {
const res = await fetch(join("/services"));
const json = await res.json();
if (!("result" in json)) return [];
return json.result;
}
export { version, join, services };