mirror of
https://github.com/khairul169/home-lab.git
synced 2025-04-28 16:49:36 +07:00
16 lines
491 B
TypeScript
16 lines
491 B
TypeScript
import { zValidator } from "@hono/zod-validator";
|
|
import { Hono } from "hono";
|
|
import { getFilesSchema, ytdlSchema } from "./schema";
|
|
import { getFiles } from "./get";
|
|
import { download } from "./download";
|
|
import { getYtdl, ytdl } from "./ytdl";
|
|
|
|
const route = new Hono()
|
|
.get("/", zValidator("query", getFilesSchema), getFiles)
|
|
.post("/upload")
|
|
.post("/ytdl", zValidator("json", ytdlSchema), ytdl)
|
|
.get("/ytdl/:id", getYtdl)
|
|
.get("/download/*", download);
|
|
|
|
export default route;
|