Viir / Kalmit

Moved to https://github.com/elm-fullstack/elm-fullstack
MIT License
2 stars 0 forks source link

How do I run my Elm app as web server (with Elm app from local files)? #8

Open Viir opened 5 years ago

Viir commented 5 years ago

A section in the readme to cover this use case would be nice. The scenario is development: I made a small change to my Elm app in local files and want to start the app to test this new version. Optional: How to add a client-side Elm app to serve as a static file. (Example configuration with a blacklist of paths which should not lead to serving the HTML client document).

Viir commented 5 years ago

Instructions found in https://github.com/Viir/Kalmit/commit/d4fe1b3091b304c2434c0cdd3cd74c3c504aaaa9 :

Use the build-config command line option to build the configuration from the Elm app files in the current working directory. To make using this option even simpler, provide a default for the process store location. Full command can look like this:

dotnet "path/to/PersistentProcess.WebHost.dll" build-config`
Viir commented 5 years ago

The example I found:

This was sufficient to bring up the web server. This also reused the state from a previous instance, as it reuses the same directory for the process store.

This example already demonstrates how to configure so that requests to paths outside of /api/ are served by sending the frontend HTML document.