diff options
| author | Ritesh Ghosh <[email protected]> | 2024-10-06 01:13:23 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-06 01:13:23 +0530 |
| commit | 46f688ac12a99b8fb145b0745dd4cc6babff1e1e (patch) | |
| tree | 9560dd057822069a2162ef01a1118f3ac05e6d07 /src/controllers/animeAboutInfo.controller.ts | |
| parent | 55810ccf2372209f9b46c96ac12811e5a05f7961 (diff) | |
| download | aniwatch-api-46f688ac12a99b8fb145b0745dd4cc6babff1e1e.tar.xz aniwatch-api-46f688ac12a99b8fb145b0745dd4cc6babff1e1e.zip | |
Aniwatch API Version 2 (#66)
BREAKING CHANGE:
* chore: remove files that are not necessary for api v2
* test: update existing tests to use pkg
* feat: organized aniwatch api envs and add more info about them
* feat: update tsconfig to include strict noUnsed params
* feat(api homepage): revamp api home page
* feat: update wani kuni image
* feat: add dot img
* feat: use hono cors
* feat: use hono rate limiter
* build: remove unnecessary deps, add ones needed and update description
* feat: add hianime routes and their handlers
* feat: update vercel deployment file
* docs: update logo and scraper docs, add envs section
* feat: update main server file
* feat: update peronal deployments caution section
Diffstat (limited to 'src/controllers/animeAboutInfo.controller.ts')
| -rw-r--r-- | src/controllers/animeAboutInfo.controller.ts | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/controllers/animeAboutInfo.controller.ts b/src/controllers/animeAboutInfo.controller.ts deleted file mode 100644 index 6d50b50..0000000 --- a/src/controllers/animeAboutInfo.controller.ts +++ /dev/null @@ -1,31 +0,0 @@ -import createHttpError from "http-errors"; -import { type RequestHandler } from "express"; -import { scrapeAnimeAboutInfo } from "../parsers/index.js"; -import { type AnimeAboutInfoQueryParams } from "../types/controllers/index.js"; - -// /anime/info?id=${anime-id} -const getAnimeAboutInfo: RequestHandler< - unknown, - Awaited<ReturnType<typeof scrapeAnimeAboutInfo>>, - unknown, - AnimeAboutInfoQueryParams -> = async (req, res, next) => { - try { - const animeId = req.query.id - ? decodeURIComponent(req.query.id as string) - : null; - - if (animeId === null) { - throw createHttpError.BadRequest("Anime unique id required"); - } - - const data = await scrapeAnimeAboutInfo(animeId); - - res.status(200).json(data); - } catch (err: any) { - console.error(err); - next(err); - } -}; - -export default getAnimeAboutInfo; |
