diff --git a/Readme.md b/Readme.md index 64224d0..93dac23 100644 --- a/Readme.md +++ b/Readme.md @@ -61,7 +61,13 @@ HTTPure ships with a number of [examples](./docs/Examples). To run an example, in the project root, run: ```bash -make example EXAMPLE= +nix-shell --run 'example ' +``` + +Or, without `nix`: + +```bash +spago -x test.dhall run --main Examples..Main ``` Each example's startup banner will include information on routes available on @@ -72,7 +78,13 @@ the example server. To run the test suite, in the project root run: ```bash -make test +nix-shell --run check +``` + +Or, if `nix` isn't your thing: + +```bash +purs-tidy check src test docs && spago -x test.dhall test ``` ## Contributing diff --git a/docs/Examples/AsyncResponse/Readme.md b/docs/Examples/AsyncResponse/Readme.md index 80bc1f3..2918ab3 100644 --- a/docs/Examples/AsyncResponse/Readme.md +++ b/docs/Examples/AsyncResponse/Readme.md @@ -8,5 +8,11 @@ file [Hello](./Hello). To run the example server, run: ```bash -make example EXAMPLE=AsyncResponse +nix-shell --run 'example AsyncResponse' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.AsyncResponse.Main ``` diff --git a/docs/Examples/BinaryRequest/Readme.md b/docs/Examples/BinaryRequest/Readme.md index 064d3a8..a6108ac 100644 --- a/docs/Examples/BinaryRequest/Readme.md +++ b/docs/Examples/BinaryRequest/Readme.md @@ -6,5 +6,11 @@ binary file and send back the file's sha256 checksum. To run the server, run: ```bash -make example EXAMPLE=BinaryRequest +nix-shell --run 'example BinaryRequest' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.BinaryRequest.Main ``` diff --git a/docs/Examples/BinaryResponse/Readme.md b/docs/Examples/BinaryResponse/Readme.md index 50cacaa..97fdd28 100644 --- a/docs/Examples/BinaryResponse/Readme.md +++ b/docs/Examples/BinaryResponse/Readme.md @@ -6,5 +6,11 @@ file as binary data on any URL. To run the server, run: ```bash -make example EXAMPLE=BinaryResponse +nix-shell --run 'example BinaryResponse' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.BinaryResponse.Main ``` diff --git a/docs/Examples/Chunked/Readme.md b/docs/Examples/Chunked/Readme.md index 36852ba..e2c21b2 100644 --- a/docs/Examples/Chunked/Readme.md +++ b/docs/Examples/Chunked/Readme.md @@ -6,5 +6,11 @@ in two separate chunks spaced a second apart on any URL. To run the example server, run: ```bash -make example EXAMPLE=Chunked +nix-shell --run 'example Chunked' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.Chunked.Main ``` diff --git a/docs/Examples/CustomStack/Readme.md b/docs/Examples/CustomStack/Readme.md index 31e1f67..3730dd7 100644 --- a/docs/Examples/CustomStack/Readme.md +++ b/docs/Examples/CustomStack/Readme.md @@ -7,5 +7,11 @@ globally-available environment during routing. To run the example server, run: ```bash -make example EXAMPLE=CustomStack +nix-shell --run 'example CustomStack' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.CustomStack.Main ``` diff --git a/docs/Examples/Headers/Readme.md b/docs/Examples/Headers/Readme.md index 96762c8..5d3921d 100644 --- a/docs/Examples/Headers/Readme.md +++ b/docs/Examples/Headers/Readme.md @@ -8,5 +8,11 @@ value 'hello world!'. To run the example server, run: ```bash -make example EXAMPLE=Headers +nix-shell --run 'example Headers' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.Headers.Main ``` diff --git a/docs/Examples/HelloWorld/Readme.md b/docs/Examples/HelloWorld/Readme.md index e6a9da4..800256d 100644 --- a/docs/Examples/HelloWorld/Readme.md +++ b/docs/Examples/HelloWorld/Readme.md @@ -6,5 +6,11 @@ making any request. To run the example server, run: ```bash -make example EXAMPLE=HelloWorld +nix-shell --run 'example HelloWorld' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.HelloWorld.Main ``` diff --git a/docs/Examples/Middleware/Readme.md b/docs/Examples/Middleware/Readme.md index 6c7a1f0..0ef4e1c 100644 --- a/docs/Examples/Middleware/Readme.md +++ b/docs/Examples/Middleware/Readme.md @@ -9,5 +9,11 @@ the response, and one that handles requests to a given path. To run the example server, run: ```bash -make example EXAMPLE=Middleware +nix-shell --run 'example Middleware' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.Middleware.Main ``` diff --git a/docs/Examples/MultiRoute/Readme.md b/docs/Examples/MultiRoute/Readme.md index fa757af..e28900e 100644 --- a/docs/Examples/MultiRoute/Readme.md +++ b/docs/Examples/MultiRoute/Readme.md @@ -7,5 +7,11 @@ return 'hello' when requesting /hello with an HTTP GET, and it will return To run the example server, run: ```bash -make example EXAMPLE=MultiRoute +nix-shell --run 'example MultiRoute' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.MultiRoute.Main ``` diff --git a/docs/Examples/PathSegments/Readme.md b/docs/Examples/PathSegments/Readme.md index f51a170..3118247 100644 --- a/docs/Examples/PathSegments/Readme.md +++ b/docs/Examples/PathSegments/Readme.md @@ -7,5 +7,11 @@ that routes based on the value of specific segments. To run the example server, run: ```bash -make example EXAMPLE=PathSegments +nix-shell --run 'example PathSegments' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.PathSegments.Main ``` diff --git a/docs/Examples/Post/Readme.md b/docs/Examples/Post/Readme.md index 04ad46f..1bbd173 100644 --- a/docs/Examples/Post/Readme.md +++ b/docs/Examples/Post/Readme.md @@ -6,5 +6,11 @@ any path with the post body in the response body. To run the example server, run: ```bash -make example EXAMPLE=Post +nix-shell --run 'example Post' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.Post.Main ``` diff --git a/docs/Examples/QueryParameters/Readme.md b/docs/Examples/QueryParameters/Readme.md index 9663e6c..3bb9f5b 100644 --- a/docs/Examples/QueryParameters/Readme.md +++ b/docs/Examples/QueryParameters/Readme.md @@ -8,5 +8,11 @@ example where the response is driven by the contents of a query parameter. To run the example server, run: ```bash -make example EXAMPLE=QueryParameters +nix-shell --run 'example QueryParameters' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.QueryParameters.Main ``` diff --git a/docs/Examples/SSL/Readme.md b/docs/Examples/SSL/Readme.md index 725bbcf..eab14be 100644 --- a/docs/Examples/SSL/Readme.md +++ b/docs/Examples/SSL/Readme.md @@ -9,5 +9,11 @@ certificate errors when testing. To run the example server, run: ```bash -make example EXAMPLE=SSL +nix-shell --run 'example SSL' +``` + +Or, without nix: + +```bash +spago -x test.dhall run --main Examples.SSL.Main ```