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

240
Views
Setup order of use between api.use and routes created by nestJS NestFactory

I have a nestJS project and i want to proxy all API requests(using http-proxy-middleware) except the routes defined in the nestJS modules.

but nestJS seems to place app.use requests as priority.

How do I tell nestJS to take the AppModule routes as priority and call /api from the proxy only when the route is not present in the AppModule

e.g when I call /api/dosomething it says not found

    // AppModule contains routes such as `/api/dosomething
    const app = await NestFactory.create(AppModule);
    
    
    app.use('/api/*', proxy.createProxyMiddleware({
      target: '/path/to/service', // contains /api/doanotherthing
      changeOrigin: true,
      secure: false,
    })
  );

about 4 years ago · Juan Pablo Isaza
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!