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/route1 for instance) to the index.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!
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 :
/app/app/assets/xxxx/app/route1for instance) to theindex.htmlFor now, my static assets are not served properly because it will search for
/app/assets/xxxxfiles 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.htmlon root :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!