MCQs > IT & Programming > Node.js > The following code snippet when executed, should create a web server that serves the web page 'idx.html' from 'testing5' folder. However, the syntax of lines 3 and 4 are not correct. Select the correct replacements of lines 3 and 4 from the given answer options. 1. var exp = require ('express'); 2. var serveStatic = require ('serve-static'); 3. var app = express() 4. .use(serveStatic(dirname /testing5, {'index': ['idx.html']})) 5. .listen(3000);

Node.js MCQs

The following code snippet when executed, should create a web server that serves the web page 'idx.html' from 'testing5' folder. However, the syntax of lines 3 and 4 are not correct. Select the correct replacements of lines 3 and 4 from the given answer options.

1. var exp = require ('express');

2. var serveStatic = require ('serve-static');

3. var app = express()

4. .use(serveStatic(dirname /testing5, {'index': ['idx.html']}))

5. .listen(3000);


Answer

Correct Answer:

var app = expo

.use(serveStatic(_dirname +‘/testing5'.{'index': ['idx.html']])) 


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it