diff options
| author | Ritesh Ghosh <[email protected]> | 2023-08-03 01:26:18 +0530 |
|---|---|---|
| committer | Ritesh Ghosh <[email protected]> | 2023-08-03 01:26:18 +0530 |
| commit | efdf83716301ccb8896c59aff98ff97de2d15545 (patch) | |
| tree | 4757b34e20091a5185ae3cee520992dd90a6ffab /src/controllers | |
| parent | 0c4fc946891ba8d7602eb3d1feae06c21bf3fe98 (diff) | |
| download | aniwatch-api-efdf83716301ccb8896c59aff98ff97de2d15545.tar.xz aniwatch-api-efdf83716301ccb8896c59aff98ff97de2d15545.zip | |
feat(homeController): added home route controller
Diffstat (limited to 'src/controllers')
| -rw-r--r-- | src/controllers/homePage.controller.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/controllers/homePage.controller.ts b/src/controllers/homePage.controller.ts new file mode 100644 index 0000000..c5ee45b --- /dev/null +++ b/src/controllers/homePage.controller.ts @@ -0,0 +1,19 @@ +import { scrapeHomePage } from "../parsers"; +import { Request, Response, NextFunction, Handler } from "express"; + +// /anime/home +const getHomePage: Handler = async ( + req: Request, + res: Response, + next: NextFunction +) => { + try { + const data = await scrapeHomePage(); + res.status(200).json(data); + } catch (err: any) { + console.error(err); + next(err); + } +}; + +export default getHomePage; |
