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

186
Vistas
How can I deal with amazon gateway prepending all url paths with /dev?

I have a FastAPI app where I have mounted a directory for static files like:

api.mount("/static", StaticFiles(directory=os.path.join(this_directory, "static")))

When I deploy my FastAPI app to AWS, the API-gateway stage is called dev so all URL paths start with a /dev so in my HTML files, links like:

<script src="/static/js/jquery-3.6.0.min.js"></script>

Now no longer point to the correct location, instead, they need to point to

<script src="/dev/static/js/jquery-3.6.0.min.js"></script>

I can go through and change all the links to start with /dev but then when I want to make a production stage, the links will now start at /prod.

How can I set up Mangum/Uvicorn to deal with a different start path to the URL?

For reference, I set up my api-gateway using ANY to /{proxy+} resource of a lambda function with a FastAPI app.

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