aboutsummaryrefslogtreecommitdiff
path: root/src/controllers/homePage.controller.ts
blob: a3f7d539589f9a635c623beccbc956e46628bc6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { RequestHandler } from "express";
import { scrapeHomePage } from "../parsers";

// /anime/home
const getHomePageInfo: RequestHandler<
  unknown,
  Awaited<ReturnType<typeof scrapeHomePage>>
> = async (req, res, next) => {
  try {
    const data = await scrapeHomePage();
    res.status(200).json(data);
  } catch (err: any) {
    console.error(err);
    next(err);
  }
};

export default getHomePageInfo;