Kizspy | Question: 12
(Choose 2 answers)
Consider the following code snippet using Express.js. Identify the parts responsible for defining a route and
starting the server.
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello, world!");
});
app.listen(3000, () => {
});
console.log('Server is running on port 3000');
A. The require('express') statement defines the route.
B. The app.get('/', (req, res) => { ... }) statement defines the route.
C. The app.listen(3000, () => { ... }) statement starts the server.
D. The res.send('Hello, world!") statement starts the server.