diff --git a/src/index.ts b/src/index.ts index 0b6d2fd..3ba0c2b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,11 @@ app.get("/a/:id", slow, limiter, (req, res) => { res.redirect(301, `https://asmhentai.com/g/${req.params.id}`); }); +app.get("/to/:id", slow, limiter, (req, res) => { + if (!isNumeric(req.params.id)) throw Error("This path need required number to work"); + res.redirect(301, `https://nhentai.to/g/${req.params.id}`); +}); + app.use((req: Request, res: Response, next: NextFunction) => { res.status(404); next(Error(`The page not found in path ${req.url} and method ${req.method}`));