What does the app use do in Express

0 votes
Jul 3, 2019 by shubham
• 7,320 points
69 views

1 answer to this question.

0 votes

app.use() is mounted to the specific path. So whenever this route is hit it executes the function which is inside it gets executed.

var express = require('express');
var app = express();

app.use('/application', function(req, res, next){
   console.log("Request is recieved at " + Date.now());
   next();
});

app.get('/application', function(req, res){
   res.send('express');
});
app.listen(3000);

answered Jul 3, 2019 by sunshine
• 1,280 points

Related Questions

0 votes
2 answers

What is the use of @Override annotation in Java ? When do we use it ?

@Override annotation is used when we override ...READ MORE

answered Aug 14, 2019 in Java by Sirajul
• 58,950 points
589 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
1,767 views
0 votes
1 answer

What does the return statement do in Python?

The print() function is use to write ...READ MORE

answered Oct 1, 2018 in Python by SDeb
• 13,250 points
407 views
+1 vote
1 answer

What does the Raise keyword do in Python?

Hi! I think I can answer this - ...READ MORE

answered Jan 25, 2019 in Python by Nymeria
• 3,520 points
217 views
0 votes
1 answer

What does the sink function do in R?

sink diverts R output to a connection ...READ MORE

answered May 24, 2019 in Data Analytics by Chandu
250 views
0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

answered May 27, 2019 in Python by Vinod
479 views
0 votes
1 answer

What to do when len() does not return the number of integers in range(1,100)?

You can use the following code block: x=range(1,100) len(x) Output: ...READ MORE

answered May 28, 2019 in Python by Fata
• 1,050 points
83 views
0 votes
1 answer

What does the map() method do in Python?

The map() function in Python is a ...READ MORE

answered Jun 17, 2019 in Python by anonymous
107 views
0 votes
1 answer

What does the penup() do in Python(turtle module)

penup() basically makes sure that the moving ...READ MORE

answered Jun 21, 2019 in Python by Iris
779 views
0 votes
1 answer

What does the operator "/=" do in python?

x = 20 res = x /= 5 print(res) The ...READ MORE

answered Aug 2, 2019 in Python by Mohammad
• 3,210 points
84 views