We'll learn an alternative way of creating API routes using the next-connect package. next-connect gives us an alternative that would feel familiar to anyone that has worked with Express in the past.
The package has to be imported first: yarn add next-connect if you are using yarn or npm i next-connect if you are uing npm.
yarn add next-connect
npm i next-connect
The package has to be imported first:
yarn add next-connect
if you are using yarn ornpm i next-connect
if you are uing npm.