SDN302_-_FA_2024_-_Block_5_-_FE_3224.webp
B

SDN302_-_FA_2024_-_Block_5_-_FE_3224.webp

Kizspy | Question: 19
(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.

Thông tin

Category
SDN302
Thêm bởi
Bích Thủy
Ngày thêm
Lượt xem
3,542
Lượt bình luận
19
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom