The :hoplon: ClojureScript Web Framework - http://hoplon.io/
Ruben W 2017-11-25T23:49:51.000019Z

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: <http://localhost> -> loads <http://localhost/index.html.js> - nested path which doesn’t work: <http://localhost/nested/path> -> tries to load <http://localhost/nested/index.html.js> 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?

flyboarder 2017-11-25T23:50:26.000029Z

@freakinruben are you looking for a single page app?

Ruben W 2017-11-25T23:50:33.000006Z


flyboarder 2017-11-25T23:50:52.000036Z

paths start with #

Ruben W 2017-11-25T23:51:51.000016Z

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 W 2017-11-25T23:52:35.000045Z

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

flyboarder 2017-11-25T23:52:58.000016Z

so that would be on the server side of things then

flyboarder 2017-11-25T23:53:38.000062Z

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

Ruben W 2017-11-25T23:53:41.000068Z

right, unless there is a possibility to define a &lt;base .. &gt; in the generated html by hoplon

flyboarder 2017-11-25T23:54:35.000059Z

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

flyboarder 2017-11-25T23:55:13.000061Z


Ruben W 2017-11-25T23:55:26.000028Z

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

flyboarder 2017-11-25T23:56:04.000047Z

ah I see what you mean,

Ruben W 2017-11-25T23:59:06.000013Z

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

flyboarder 2017-11-25T23:59:50.000009Z

we have a base element