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

86
Views
Multiple React apps on express

I have a server on express.js and there is a static folder in its root directory, it contains several react apps, something like this:

app:
    static:
           react1
           react2

I am trying to make sure that when accessing the /react1 and /react2 addresses, the express will display the required application.

app.js:

app.use (express.static(path.join(__ dirname, "static")));
app.use ("/", indexRouter);

index.router:

router.get('/react1', (req, res) => {
  res.sendFile(path.join (__dirname, '..', 'static', 'react1', 'index.html'))
});

router.get('/react2', (req, res) => {
  res.sendFile(path.join (__dirname, '..', 'static', 'react2', 'index.html'))
});

When I try to navigate through these handles, I get a blank page. What am I doing wrong?

about 4 years ago · Santiago Trujillo
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!