BED AY25S2 Formative: npm, http routes

BED AY25S2 Formative: npm, http routes

2nd Grade

12 Qs

quiz-placeholder

Similar activities

Programação e Aprendizagem Móvel

Programação e Aprendizagem Móvel

2nd Grade

11 Qs

2A SOPORTE EXAMEN 1ER PARCIAL CULTURA DIGITAL

2A SOPORTE EXAMEN 1ER PARCIAL CULTURA DIGITAL

2nd Grade

15 Qs

QUIZ MY BCA

QUIZ MY BCA

1st Grade - University

10 Qs

SQL Dasar

SQL Dasar

2nd Grade

10 Qs

Quiz week 3

Quiz week 3

2nd Grade

10 Qs

BED AY25S2 Formative: npm, http routes

BED AY25S2 Formative: npm, http routes

Assessment

Quiz

Information Technology (IT)

2nd Grade

Practice Problem

Hard

Created by

Larry Thng

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts


Which line of code correctly initializes an Express application instance?

const app = new express();

const app = express.create();

const app = express.init();

const app = express()

2.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

Which code is used to create a route that handles an HTTP POST request to the path /users?

app.get('/users',
(req, res) => {...})

app.put('/users',
(req, res) => {...})

app.delete('/users',
(req, res) => {...})

app.post('/users',
(req, res) => {...})

3.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

In the route /items/:id, how do you access the value of the dynamic route :id?

req.body.id
req.params.id
req.query.id
req.headers.id

4.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

For the request /users?status=active,
how do you access the value of the query parameter?

req.params.status

req.query.status

req.body.status

req.url.status

5.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

Which method starts the Express server and binds it to a specified port?

app.start()
server.run()
app.listen()
express.init()

6.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

Which npm command installs the express package
and adds it as a production dependency to package.json?

npm add express

npm install --save express

npm get express

npm install express

7.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

To execute a custom script named "deploy" in your package.json, which npm command must you use?

npm run deploy
npm start deploy
npm exec deploy
npm deploy

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?