(refractor) timer and warm up query

This commit is contained in:
polv committed 2026-03-03 12:44:54 +07:00
1 parent 1b2ee0f691
commit d6f2b145c3
13 files changed
+294 -47

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import fastify from "fastify";
import { readdirSync } from "fs";
import path from "path";
import fastifyStatic from "@fastify/static";
const app = fastify({
logger: true,
});
const YOMITAN_PATH = path.join(__dirname, "../src-tauri/resources/yomitan/ja");
app.register(fastifyStatic, {
root: YOMITAN_PATH,
prefix: "/api/files/yomitan/ja",
});
app.get("/api/yomitan/ja/list", async () => {
return {
list: readdirSync(YOMITAN_PATH).filter((p) => p.endsWith(".zip")),
};
});
app.listen({ port: 3000 }).catch((e) => {
app.log.error(e);
process.exit(1);
});