next-connect better alternative to express(more faster than express) code example
Example: next-connect better alternative to express(more faster than express)
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();