fix: add some nhentai.to consumes (#26)

このコミットが含まれているのは:
Indrawan I 2023-05-16 15:50:31 +07:00 committed by GitHub
コミット c7d6380fdb
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更5行の追加0行の削除

ファイルの表示

@ -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}`));