Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda