-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hi! Thanks for your work on this image.
I'm publishing an SPA on a subpath, let's say on https://example.com/app/. I want to serve :
- My index.html on
/app - My static assets on
/app/assets/xxxx - Redirect my SPA routes (
/app/route1for instance) to theindex.html
For now, my static assets are not served properly because it will search for /app/assets/xxxx files ont the fs instead of /assets/xxxx.
A base url option, would allow to match the incoming URL with the file path.
A workaround is to copy the static assets to the "base url path" in the image fs while keeping the index.html on root :
FROM devforth/spa-to-http:latest AS runner
ARG BASE_URL="app"
RUN mkdir -p ${BASE_URL}
COPY --from=build /usr/src/app/dist ${BASE_URL}
RUN mv ${BASE_URL}/index.html index.html
But I think a runtime option would make it cleaner.
It's the same issue as #11 that was closed
Would like to submit a PR but i don't know GO tbh!
art-shen
Metadata
Metadata
Assignees
Labels
No labels