wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Nodejs: Express

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

Frameworks can help with ready-made solutions for common tasks and problems

a)

True

b)

False

c)

Not sure

d)

I don't know

2.

To create an express app with the imported module named express, which of the following syntax is correct?

a)

app = server()

b)

app = http.createServer()

c)

app = express()

d)

app = web()

3.

To listen for connections, what function would you use?

a)

app.listen

b)

app.serve

c)

app.connect

d)

app.start

4.

app.get('/students, callback)

Which of the following statements is false?

a)

The http method is GET

b)

The url is '/students'

c)

The callback function will contain req and res objects

d)

None of the options

5.

One of these is used to send a JSON object to the client

a)

res.send()

b)

res.json()

c)

res.status()

d)

res.render()

6.

A client has made a request for a resource but that resource is not found in our server. Select the correct syntax?

a)

res.status(301).send(data)

b)

res.status(404).send(data)

c)

res.status(500).send(data)

d)

res.status(201).send(data)

7.

What method do we use to apply a middleware in express

a)

app.use(middleware)

b)

app.apply(middleware)

c)

app.config(middleware)

d)

app.render(middleware)

8.

______ allow you to generate HTML dynamically based on data from your application.

a)

Template Engines

b)

Routers

c)

Middlewares

d)

Controllers

9.

(req, res, next) => {} .... This function serves as _______

a)

Controller

b)

Middleware

c)

Helper

d)

Template Engine

10.

Which component ends the request cycle provided all business logic are met?

a)

Middleware

b)

Controller

c)

Request Hanlder

d)

None of the options

11.

app.get('/students/:id', (req, res) = { }). How do I get the value of id?

a)

req.params.id

b)

req.query.id

c)

req.path.id

d)

req.id