mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Add /api/filemeta and /api/filemeta/[token]
This commit is contained in:
11
routes/api/filemeta/[token].ts
Normal file
11
routes/api/filemeta/[token].ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { return_error } from "../../../server/utils.ts";
|
||||
import { get_filemeta } from "../filemeta.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(_req, ctx) {
|
||||
const token = ctx.params.token;
|
||||
if (token) return get_filemeta(token);
|
||||
return return_error(400, "token is needed.");
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user