Complete the code to import the Express library.
const express = require('[1]');
The Express library is imported using require('express'). This allows us to use Express functions in our code.
Complete the code to create an Express application instance.
const app = [1]();Calling express() creates an Express application instance, which we store in app.
Fix the error in the code to make the server listen on port 3000.
app.[1](3000, () => { console.log('Server is running on port 3000'); });
The correct method to start the server listening on a port is listen.
Fill both blanks to define a GET route for the root URL that sends 'Hello World!'.
app.[1]('[2]', (req, res) => { res.send('Hello World!'); });
The get method defines a route for GET requests. The root URL is '/'.
Fill all three blanks to import Express, create an app, and start the server on port 4000.
const [1] = require('[2]'); const app = [3](); app.listen(4000, () => { console.log('Server running on port 4000'); });
We import Express with require('express'), assign it to express, then call express() to create the app.