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

120
Vistas
Can an express app handle requests made to another server

Total Http/Express noob here. Just messing around and getting stuck.

I have an app set up that is serving static pages from a public dir. I also have the following route:

app.get('*', (req, res, next)=>{
   console.log(req.url)
   next();
});

This logs all the requests that are being made on my app but when one of my static pages requests an image from a different source eg S3 or Google, then that doesn't get logged. Which makes sense as that request obviously isn't hitting any of my routes.

So is there a way that I can get express or node to be aware of those external request? Really I just need to see the URLs that assets are being requested on, similar to the Network tab in Chrome dev tools.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can do it by sending a 302 redirect from your server to the image in S3, etc. Generally, this is not a good practice because redirected requests take additional browser and network overhead. It's probably OK for a few images, but you likely don't want to do it for all.

You could also proxy the image request. In this case your server would request the image from S3 and then stream the image back to the client. This also has performance impacts on your server.

If you want to know what images were requested and how often, then using log analysis on S3 or other storage resource is probably a better way to go.

over 4 years ago · Santiago Trujillo Denunciar
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