Skip to content

Commit

Permalink
perf: implement cors for browser usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed Jun 30, 2022
1 parent 7c7741a commit 29cd7d5
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/router/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Router } from "express";
import cors from "cors";
import { searchHentaifox } from "../controller/hentaifox/hentaifoxSearch";
import { getHentaifox } from "../controller/hentaifox/hentaifoxGet";
import { getPururin } from "../controller/pururin/pururinGet";
Expand All @@ -19,22 +20,22 @@ import { slow, limiter } from "../utils/limit-options";

function scrapeRoutes() {
const router = Router();
router.get("/hentaifox/search", slow, limiter, searchHentaifox);
router.get("/hentaifox/get", slow, limiter, getHentaifox);
router.get("/hentaifox/random", slow, limiter, randomHentaifox);
router.get("/pururin/get", slow, limiter, getPururin);
router.get("/pururin/search", slow, limiter, searchPururin);
router.get("/pururin/random", slow, limiter, randomPururin);
router.get("/hentai2read/search", slow, limiter, searchHentai2read);
router.get("/hentai2read/get", slow, limiter, getHentai2read);
router.get("/simply-hentai/get", slow, limiter, getSimplyhentai);
router.get("/asmhentai/get", slow, limiter, getAsmhentai);
router.get("/asmhentai/search", slow, limiter, searchAsmhentai);
router.get("/asmhentai/random", slow, limiter, randomAsmhentai);
router.get("/nhentai/get", slow, limiter, getNhentai);
router.get("/nhentai/search", slow, limiter, searchNhentai);
router.get("/nhentai/related", slow, limiter, relatedNhentai);
router.get("/nhentai/random", slow, limiter, randomNhentai);
router.get("/hentaifox/search", cors(), slow, limiter, searchHentaifox);
router.get("/hentaifox/get", cors(), slow, limiter, getHentaifox);
router.get("/hentaifox/random", cors(), slow, limiter, randomHentaifox);
router.get("/pururin/get", cors(), slow, limiter, getPururin);
router.get("/pururin/search", cors(), slow, limiter, searchPururin);
router.get("/pururin/random", cors(), slow, limiter, randomPururin);
router.get("/hentai2read/search", cors(), slow, limiter, searchHentai2read);
router.get("/hentai2read/get", cors(), slow, limiter, getHentai2read);
router.get("/simply-hentai/get", cors(), slow, limiter, getSimplyhentai);
router.get("/asmhentai/get", cors(), slow, limiter, getAsmhentai);
router.get("/asmhentai/search", cors(), slow, limiter, searchAsmhentai);
router.get("/asmhentai/random", cors(), slow, limiter, randomAsmhentai);
router.get("/nhentai/get", cors(), slow, limiter, getNhentai);
router.get("/nhentai/search", cors(), slow, limiter, searchNhentai);
router.get("/nhentai/related", cors(), slow, limiter, relatedNhentai);
router.get("/nhentai/random", cors(), slow, limiter, randomNhentai);

return router;
}
Expand Down

0 comments on commit 29cd7d5

Please sign in to comment.