The app.mountpath property contains one or more path patterns on which a sub-app was mounted.
Parameter: No parameters.
Return Value: String.
Installation of express module:
- You can visit the link to Install express module. You can install this package by using this command.
npm install express
- After installing the express module, you can check your express version in command prompt using the command.
npm version express
- After that, you can just create a folder and add a file for example, index.js. To run this file you need to run the following command.
Example 1: Filename: index.js
Steps to run the program:
- The project structure will look like this:
- Make sure you have installed express module using the following command:
npm install express
- Run index.js file using below command:
Server listening on PORT 3000
Now open your browser and go to http://localhost:3000/user, now you can see the following output on your console:
Server listening on PORT 3000 /user
Example 2: Filename: index.js
Run index.js file using below command:
Output: Now open your browser and make GET request to http://localhost:3000, now you can see the following output on your console:
Server listening on PORT 3000 /
- Routing Path for ExpressJS
- Scaffolding an ExpressJS app from scratch
- HandleBars Templating in ExpressJS
- CSS | transition-property Property
- CSS | top Property
- CSS | nav-right property
- CSS gap Property
- CSS | nav-down property
- CSS | nav-up property
- CSS | all Property
- CSS | right Property
- CSS | overflow-x Property
- CSS | box-shadow Property
- CSS | min-width Property
- CSS | bottom Property
- HTML | DOM URL Property
- HTML | DOM Bdo dir Property
- CSS | order property
- HTML | DOM specified Property
- CSS | cursor property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.