2022-05-01 22:19:46 +00:00
|
|
|
import NextCors from "nextjs-cors";
|
2022-04-10 18:26:47 +00:00
|
|
|
import { getByDiscordId } from "../../../../lib/borders";
|
|
|
|
|
2022-05-01 22:19:46 +00:00
|
|
|
export default async function handler(req, res) {
|
2022-04-10 18:26:47 +00:00
|
|
|
const id = req.query.id;
|
|
|
|
|
2022-05-01 22:19:46 +00:00
|
|
|
await NextCors(req, res, {
|
|
|
|
methods: ["GET", "HEAD"],
|
|
|
|
origin: "*",
|
|
|
|
optionsSuccessStatus: 200,
|
2022-04-10 18:26:47 +00:00
|
|
|
});
|
2022-05-01 22:19:46 +00:00
|
|
|
|
|
|
|
const result = await getByDiscordId(id);
|
|
|
|
const borderUrl = result ?? "0";
|
|
|
|
|
|
|
|
return res.status(200).send(borderUrl);
|
2022-04-10 18:26:47 +00:00
|
|
|
}
|