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

184
Views
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
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!