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.