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

125
Views
How to separate the frontend routing from backend endpoints?

I have an express server which handle some routes

/users/login
/users/register 
/orders/add

and so on..

serving a static files, in the default route "/"

so, if user navigated to domain.com for example

it will navigate to that static files

these static files are a react frontend app

the default url "/" will navigate to a login page

and "/dashboard" will navigate to another page

what actually happen, is there's kind of conflict between the backend and frontend routes

for example

if user navigated to "/dashboard"

the expected result is to navigate him to the frontend page

what actual happen is "the backend handle that route not the frontend" and simply return : "I don't have that route (404)

What was in my mind is to navigate any not handled route to the frontend

using that code

  app.get('*', async function (request, reply) {
    return reply.sendFile('index.html')
  })

however, not solved my problem

almost 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!