it mostly works!
This commit is contained in:
parent
76543fd220
commit
44cd13f10c
52 changed files with 879 additions and 396 deletions
28
src/web/endpoints/front/download.ts
Normal file
28
src/web/endpoints/front/download.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import express from "express";
|
||||
import { validate } from "../../validate.js";
|
||||
import { z } from "zod";
|
||||
import { config } from "../../../config.js";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
const schema = z.object({
|
||||
query: z.object({
|
||||
id: z.string()
|
||||
})
|
||||
});
|
||||
|
||||
router.get("/download", async (req, res, next) => {
|
||||
try {
|
||||
const { id } = (await validate(req, schema)).query;
|
||||
|
||||
res.render("download", {
|
||||
title: "download",
|
||||
codecs: config.server.frontend.displayed_codecs,
|
||||
id: id
|
||||
});
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
Loading…
Add table
Add a link
Reference in a new issue