CSE MCQs :: ExpressJS
- What are core features of Express framework?
-
What will be the output of the below code in the console?File: my_module.jsexports.name = 'Zeus';Code:var my_module = require('./mymodule');console.log((function(settings){return settings.split('').reverse().join('')})(my_module.name));
- How to store local variables that can be access within the application?
- Route paths, in combination with a request method, define the endpoints at which requests can be made. Which of following are valid form of route path?
- Where is captured values are populated regarding route parameters?
- What function arguments are available to Express.js Route handlers?
- How can we create chainable route handlers for a route path in ExpressJS app?
- What are the commands are used to enable debugging in Express App?
- In ExpressJS, the method app.all(path, callback [, callback ...]) can accept all HTTP methods
-
Imagine that you sent following ajax request:$.post("/process", {name:'john'}, function(data){// Do some stuff});What will be the answer from the server?Tip: On server side, we have the code which is given belowCode:app.post('/process', function(req, res){var data = '';if(req.xhr){data += 'One';}if(req.body.name){data += 'Two';}res.send(data);});