Does elm-spa not work in github.io pages?

I tried to upload a short piece of elm-spa to Github Pages.
It works only on the local host if run with elm-spa server.

the source: src/Pages/Home_.elm

run with public/index.html successfully using elm-spa server on localhost:1234/

the file elm.js is built and minimized with elm build

Is this the solution for use in github.io , redirect all URLs to index.html ?
Is Netifly more suitable for this purpose?

I’d probably prefer Netlify as GH Pages hosts your site at /repo-name and not at /. It makes handling links kind of annoying for anything multipage.

As I have already ryannhg/elm-spa installed, maybe changing it to Elm Land does not make sense.

One alternative more is orus-io/elm-spa.

However, I would’nt like to stop using of my GH Pages because of Netlify.

Changing to orus-io/elm-spa won’t make this situation any easier. The issue is how GH Pages are hosted. You can change your site around to include that nested routing, but it’s still a pain compared to hosting somewhere else.

Not to dissuade you from trying orus-io/elm-spa or Elm Land, both are solid options.

There are alternatives to Netlify as well, such as http://surge.sh/, https://vercel.com/, and more.

1 Like

I think, I’ll try one which is easy to use and attractive enough, just for learning purpose. So, maybe Ryan’s elm-spa on mac OS or Elm Land on Ubuntu Linux, both with Netlify.

Thank you for advices given!

I tried just elm-land on my macOS without installing it (with npx).
An interesting error appeares when I start the server.

So I’ll continue using elm-spa instead of elm-land in case of macOS.
Note, elm-land works Ok on my Ubuntu Studio at Intell PC desktop.

Elm Land has a nice Discord server Elm Land where people have been sharing their projects and bugs and feature requests, if you’re interested.

1 Like