SDN302_-_FA_2024_-_FE_3014.webp
M

SDN302_-_FA_2024_-_FE_3014.webp

Kizspy | Question: 14
(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
Minh Tâm1
Ngày thêm
Lượt xem
3,308
Lượt bình luận
20
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom