mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update
This commit is contained in:
13
routes/api/config.ts
Normal file
13
routes/api/config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { load_settings } from "../../config.ts";
|
||||
import { get_cfg_path } from "../../server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(_req, _ctx) {
|
||||
const path = get_cfg_path();
|
||||
const cfg = await load_settings(path);
|
||||
return new Response(JSON.stringify(cfg.to_json()), {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user