Fork me on GitHub
#hoplon
<
2017-11-25
>
Ruben W23:11:51

I’m trying to use one index page for all my nested paths and I can’t figure out how to set the base path to load the initial index.html.js always from localhost/index.html.js. E.g.: - normal path which works: -> loads - nested path which doesn’t work: -> tries to load Is it possible to configure a base-path somewhere or should I handle this server-side and define some catch-all route to the index.html.js?

flyboarder23:11:26

@freakinruben are you looking for a single page app?

flyboarder23:11:52

paths start with #

Ruben W23:11:51

yeah, but I want to use html5history api.. which works if I start navigating from index page.. But if I click on a link, and then refresh I get the problem described above 😉

Ruben W23:11:35

html5history api can ofcourse be used with #, but I’m trying to do it without

flyboarder23:11:58

so that would be on the server side of things then

flyboarder23:11:38

if it works before a refresh then the issue is the path attempting to load from the server

Ruben W23:11:41

right, unless there is a possibility to define a <base .. > in the generated html by hoplon

flyboarder23:11:35

if I just go to localhost/nested/path how does it know to use the index page? It would need a server which always returns the index no matter the path

Ruben W23:11:26

true, I have a catch all handler that always returns the hoplon generated index.html. The problem is inside the generated index.html, which tries to load the index.html.js from a relative path

flyboarder23:11:04

ah I see what you mean,

Ruben W23:11:06

if it’s not possible, I can try to define a catch-all route for the index.html.js so it’s always returned, but from a caching perspective that’s not optimal

flyboarder23:11:50

we have a base element