Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@fizruk
Copy link
Contributor

@fizruk fizruk commented Nov 18, 2017

This changes allows to serve static files from GHCJSi browser session and makes it possible to:

  • run apps with images, CSS files and other stuff from GHCJSi;
  • have custom ghcjsiClient.html and/or ghcjsiClient.js.

This relies on finalhandler and serve-static packages which one can install using npm:

npm install finalhandler serve-static

I'm not savvy with nam packages, and there seem to be more alternatives to static file servers.
If you think different packages should be used — feel free to change that.

By default static server is disabled. To serve files set GHCJSI_STATIC_DIR environment variable, e.g:

export GHCJSI_STATIC_DIR=$(pwd)/static

A gist with example usage: https://gist.github.com/fizruk/fb5bad8a08a4b788764851c11ebbadf8

@dmjio
Copy link

dmjio commented Nov 19, 2017

Bravo @fizruk :) not afraid to write js!

@fizruk
Copy link
Contributor Author

fizruk commented May 6, 2018

I've just uploaded a Docker image fizruk/stack-ghcjs with support for static files built in.
Hopefully this will be useful to someone besides me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants