We'll start by using create-next-app for creating a new Next.js app.
now we will add two more dependencies: Express.js and Krabs:
We will also need to create a custom server for handling our Next.js instance. If you haven't already, please read the caveats section.
Let's create a new file called
server.js. It will be the entry point of our custom Express.js server.
As you can see, the krabs function accepts four parameters:
req: Express.js request object
res: Express.js response object
handle: the Next.js route handler
app: the Next.js app object