Next-Connect Lepsze alternatywę dla ekspresji (szybciej niż ekspresy)
import nextConnect from 'next-connect'const handler = nextConnect(); // use middlewarehandler.use(someMiddleware()); // response to GEThandler.get(function (req, res) { res.send('Hello world');}); // response to POSThandler.post(function (req, res) { res.json('Hi there');}); // export using handler.export()export default handler.export();
Careful Civet