Move packages/apps back

This commit is contained in:
Darren Clarke 2023-03-10 08:26:51 +00:00
parent 6eaaf8e9be
commit 5535d6b575
348 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import { NextApiRequest, NextApiResponse } from "next";
import { getToken } from "next-auth/jwt";
import { getTrends } from "lib/opensearch";
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const session = await getToken({
req,
secret: process.env.NEXTAUTH_SECRET,
});
if (!session) {
return res.redirect("/login");
}
const results = await getTrends(5);
return res.json(results)
};
export default handler;