UNPKG

next-plugin-preval

Version:

> Pre-evaluate async functions (for data fetches) at build time and import them like JSON

9 lines (6 loc) 204 B
import { NextApiHandler } from 'next'; import exampleData from '@/utils/example.preval'; const handler: NextApiHandler = (_req, res) => { res.status(200).json(exampleData); }; export default handler;