InvestWeb/pages/api/7tv/emotes.ts
2022-12-08 06:57:59 -08:00

20 lines
505 B
TypeScript

import type { NextApiRequest, NextApiResponse } from "next";
import { getChannelEmotes, getGlobalEmotes } from "../../../misc/7TVAPI";
type Data = {
[key: string]: any;
};
const secret = process.env.NEXTAUTH_SECRET;
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
const channel = req.query.c
? await getChannelEmotes(req.query.c as string)
: undefined;
const global = await getGlobalEmotes();
res.status(200).json({ channel, global });
}