What does the app use do in Express

0 votes
Jul 4, 2019 by shubham
• 7,340 points
148 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 4, 2019 by sunshine
• 1,300 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
• 59,230 points
3,624 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
10,880 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,300 points
1,448 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,560 points
1,260 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
1,209 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
1,147 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
901 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
890 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
6,744 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,230 points
902 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP