21 lines
430 B
TypeScript
21 lines
430 B
TypeScript
|
|
import { NextResponse } from "next/server";
|
||
|
|
// import { getToken } from "next-auth/jwt";
|
||
|
|
import { getTrends } from "@/app/_lib/opensearch";
|
||
|
|
|
||
|
|
export const GET = async () => {
|
||
|
|
/*
|
||
|
|
const session = await getToken({
|
||
|
|
req,
|
||
|
|
secret: process.env.NEXTAUTH_SECRET,
|
||
|
|
});
|
||
|
|
|
||
|
|
if (!session) {
|
||
|
|
return res.redirect("/login");
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
const results = await getTrends(5);
|
||
|
|
|
||
|
|
NextResponse.json(results);
|
||
|
|
};
|
||
|
|
|