aboutsummaryrefslogtreecommitdiff
path: root/src/controllers/homePage.controller.ts
blob: c5ee45be0678c80f21e7e5346acddf80ea4f09b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;