Add OSS friends api endpoint (#604)

This commit is contained in:
Matti Nannt
2023-07-21 16:44:41 +02:00
committed by GitHub
parent 9be053d8a6
commit b6a0d0fe5d

View File

@@ -0,0 +1,14 @@
import { OSSFriends } from "@/pages/oss-friends";
import type { NextApiRequest, NextApiResponse } from "next";
export default async function handle(req: NextApiRequest, res: NextApiResponse) {
// GET
if (req.method === "GET") {
return res.status(200).json({ data: OSSFriends });
}
// Unknown HTTP Method
else {
throw new Error(`The HTTP ${req.method} method is not supported by this route.`);
}
}