Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
What does "mount" mean in express?

I'm learning Express.js and I came across this definition:

"An Express router provides a subset of Express methods. To create an instance of one, we invoke the .Router() method on the top-level Express import. To use a router, we mount it at a certain path using app.use() and pass in the router as the second argument."

What does "mount" mean?

Thank you in advance!

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Mount simply means it prepends the path to your routes.

Say for example your routes have the following endpoints:

/list
/create
/update
/get/:id

And you mount it to /api/tasks. The endpoints will be:

/api/tasks/list
/api/tasks/create
/api/tasks/update
/api/tasks/get/:id

The way it's done in Express is:

const routes = require('./my/routes');

app.use('/api/tasks',routes);

Note: This terminology comes from how disks/drives work on Unix (Linux, MacOS etc.). Unlike Windows where disks are mounted to letters like C: or D: on Unix disks are mounted to folders. So for example if you connect a thumb drive named "Stuff" on Linux you will find a new folder called:

   /media/your_username/Stuff

And this folder will contain all the data of the thumbdrive. This is done by the automounter but you can also manually mount drives to empty folders. For example if I install the right software on my machine I can mount a remote shared drive to /Users/my_username/projects/shared_drives/shared_pictures.

So it's natural for programmers to call the act of adding things to paths mounting.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!