Complete the code to import the Next.js server creation function.
import { createServer } from '[1]';
The createServer function is imported from the http package to create an HTTP server for Next.js.
Complete the code to initialize the Next.js app with the correct configuration.
const app = next({ dev: [1] });Setting dev to true enables development mode for the Next.js app.
Fix the error in the server listen call by completing the port number.
server.listen({ port: [1] }, () => console.log('Server running'));The port number should be a number, not a string or other type.
Fill both blanks to handle requests and prepare the Next.js app.
const handle = app.[1](); app.[2]().then(() => { /* server start code */ });
getRequestHandler returns the request handler function, and prepare prepares the app before starting the server.
Fill all three blanks to create a simple HTTP server that uses Next.js request handler.
import http from 'http'; const server = http.createServer(app.[1]()); server.[2]({ port: [3] }, () => console.log('Server started'));
The server uses getRequestHandler to handle requests, and listen to start on port 3000.