Skip to content

Commit

Permalink
fix: add some nhentai.to consumes
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed May 16, 2023
1 parent 8f8ac8e commit b3f43ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`));
Expand Down

0 comments on commit b3f43ab

Please sign in to comment.