dman926 / SEPHIRA-CMS

An Angular 13 front end with a complete FastAPI backend. Perfect for getting your next project off the ground
MIT License
9 stars 6 forks source link

Dynamic page module loading on image requests #38

Closed dman926 closed 2 years ago

dman926 commented 2 years ago

Describe the bug There's a bug with angular universal where certain image requests will load the wildcard route as well as serve the image. I don't really know why this happens, but removing the wildcard route fixes it.

To Reproduce Steps to reproduce the behavior:

  1. Uncomment the wildcard route in app-routing.modue.ts
  2. Go the /shop/checkout with at least 1 item in the cart
  3. Go to checkout with NOWPayments
  4. See a bunch of FastAPI requests for a page with the slug argument being the image location

Expected behavior The wildcard route should not load at all as server.ts has a route specifically for static files

dman926 commented 2 years ago

Figured out what is happening. The some images 404 and fall through to the wildcard. Instead of using the fallthrough option in express.static, I'll fetch the return the available coin images through the /payment/nowpayments/available-coins route instead to avoid 404s