Closed tommed closed 1 year ago
Doesn't matter. I've managed to replace this program with a few lines of express code. It has also allowed me to set CSP, Permissions Policy etc.
Here's the implementation if anyone needs is: https://gist.github.com/tommed/a9a07d4c045d1e10614a86f25cbbfda7
Hi there, my vite.config.js file contains a base URL:
This is because I'm using a load balancer (and path prefix) for this service.
However, this does not appear to work with this docker image, as all static files no longer map correctly to the files. The paths map correctly, but literally all asset requests return with the index.html as the response (e.g.,
https://MY_DOMAIN/london/fileshare/assets/index-c9fdd385.css
returns with the contents of index.html).This is because the relative path you're receiving contains the path prefix, and you're probably scanning for a local directory called
london/fileshare/assets
rather thanassets
. How can I support scenario please?If I remove the
base
value from vite, the assets are in the index.html as/assets
which obviously wrong as it's referring to the root directory which is outside of this app. I need a way of feeding into your web server the relative path of this service.FYI, when I use
gin
as my web server for my own go projects, I simply set-up my routing based on the relative path like so:Could you not do something similar? Apologies if I've missed some documentation somewhere.