SPA demo not working when deploy on subpath of domain
Describe the Bug
The SPA demo is not working when I deploy it on the subpath of the domain.
I followed the document from here: https://nuejs.org/docs/reference/configuration-options.html#base and modified some static paths on the app.
Environment
- Bun 1.1.6
- Nue 0.5.3
Minimal Reproduction
For details, I created a repository for demonstration purposes here. I will delete it after this issue is finished.
Hello, I was looking through older issues, and I checked your demo, and there are some more paths, that have to be changed. Then it works.
The following would be necessary:
- The
router.onpaths inapp.nuehave to use the full urls:/nuejs/… - The imports in
app.nueneed can just use relative imports./@nue/…/./model/… - The
hrefin the nav inapp.nuemight need trailing slash. Not sure, may be different between servers. - The
fetchin/model/index.tsshould use relative paths:./model/…
[!note] The
router.onpart and ability to use{base}inhrefs (currently not working here) should probably be improved in nue(kit). But SPA stuff is as I can see still low priority
The stuff then has to be deployed/served on a subpath. At least locally it works for me after those changes.
(Currently, with the new beta it seems, like index.html doesn't work anymore. Just use index.md with following content instead: [app :title :description] )