icns-frontend/pages/api/allowlist.ts
2022-12-21 18:18:38 +09:00

24 lines
529 B
TypeScript

import type { NextApiRequest, NextApiResponse } from "next";
import { CHAIN_ALLOWLIST } from "../../constants/icns";
import Cors from "cors";
const cors = Cors({
methods: ["GET"],
});
export default async function (req: NextApiRequest, res: NextApiResponse) {
await new Promise((resolve, reject) => {
cors(req, res, (result: any) => {
if (result instanceof Error) {
return reject(result);
}
return resolve(result);
});
});
res.status(200).json({
chains: CHAIN_ALLOWLIST,
});
}