Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda