Loading

Quipoin Menu

Learn • Practice • Grow

express-js / Express.js Hello World
mcq
Direction: Choose the correct option

Q1.

How do you create an Express application instance?
A. const app = http.createServer();
B. const app = new Express();
C. const app = require('express');
D. const app = express();
Direction: Choose the correct option

Q2.

Which method starts the server and listens for connections?
A. app.serve()
B. app.start()
C. app.listen()
D. app.run()
Direction: Choose the correct option

Q3.

What is the default port commonly used in Express examples?
A. 8080
B. 3000
C. 5000
D. 80
Direction: Choose the correct option

Q4.

What does app.get('/') do?
A. It defines a route handler for HTTP GET requests to the root path
B. It starts the server
C. It serves a file named index.html
D. It retrieves data from a database
Direction: Choose the correct option

Q5.

What does res.send() do?
A. Sends a JSON object
B. Sends the HTTP response
C. Sends a redirect
D. Sends a file