@@ -4,24 +4,35 @@ Note: work in progress.
44
55This library lets you automatically derive [`reflex-dom`](https://github.com/reflex-frp/reflex-dom) clients that query each endpoint of a [`servant`](htps://github.com/haskell-servant/servant) webservice.
66
7−## Building the example
7+## Building the library and test server
88
9−You will need a recent [GHCJS installation](https://github.com/ghcjs/ghcjs), or use the [reflex-platform](https://github.com/reflex-frp/reflex-platform). A [snap](https://github.com/snapframework) server using [servant-snap](https://github.com/haskell-servant/servant-snap) is provided for serving the api. `Snap 1.0` is not yet on Hackage (and servant-snap is still experimental), but we bundle the sources as a git submodule. To install everything with cabal:
9+### With `reflex-platform`:
10+
11+First build the library:
1012
1113```
1214git clone https://github.com/imalsogreg/servant-reflex
1315cd servant-reflex
1416git submodule update --init --recursive
17+./build.sh
18+./toSite.sh
19+```
20+
21+(the `toSite.sh` script copies the generated javascript to the server's static assets directory)
22+
23+
24+Then build the test server (not in a nix-shell):
25+
26+```
1527./init-sandbox.sh
1628cd testserver && cabal install --only-dep && cabal build && cd ..
17−cabal install --only-dep
18−cabal build
19−./toSite
29+
2030```
2131
22−The final script copies the ghcjs-generated files into the server's static directory.
2332
24−To install with `reflex-platform`:
33+### Or, with a system-wide ghcjs
34+
35+You will need a recent [GHCJS installation](https://github.com/ghcjs/ghcjs), or use the [reflex-platform](https://github.com/reflex-frp/reflex-platform). A [snap](https://github.com/snapframework) server using [servant-snap](https://github.com/haskell-servant/servant-snap) is provided for serving the api. `Snap 1.0` is not yet on Hackage (and servant-snap is still experimental), but we bundle the sources as a git submodule. To install everything with cabal:
2536
2637```
2738git clone https://github.com/imalsogreg/servant-reflex
@@ -29,11 +40,20 @@ cd servant-reflex
2940git submodule update --init --recursive
3041./init-sandbox.sh
3142cd testserver && cabal install --only-dep && cabal build && cd ..
32−path/to/reflex-platform/work-on ./overrides.nix ./.
43+cabal install --only-dep
3344cabal build
34−./toSite.sh
45+./toSite
46+```
47+
48+The `toSite.hs` script copies the ghcjs-generated files into the server's static directory.
49+
50+## Running the example site
51+
52+```
53+testserver/dist/build/back/back
3554```
3655
56+And simply browse to `localhost:8000`
3757
3858## Example
3959