Skip to content

Commit

Permalink
Change command for running examples to
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrinkmeier committed Apr 3, 2024
1 parent 8795345 commit c74073e
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,21 @@ As for the name: Sinatra + Warp = Scotty.

## Examples

Run /basic.hs to see Scotty in action:
Run `examples/basic.hs` to see Scotty in action (if you haven't, run `cabal update` first):

```bash
runghc examples/basic.hs
```
`Setting phasers to stun... (port 3000) (ctrl-c to quit)`

Or equivalently with [`stack`](https://docs.haskellstack.org/en/stable/):

```bash
stack exec -- scotty-basic
$ cabal run scotty-basic
Setting phasers to stun... (port 3000) (ctrl-c to quit)
```

Once the server is running you can interact with it with curl or a browser:
Once the server is running you can interact with it with `curl` or a browser:

```bash
curl localhost:3000
```
`foobar`

```bash
curl localhost:3000/foo_query?p=42
$ curl localhost:3000
foobar
$ curl localhost:3000/foo_query?p=42
<h1>42</h1>
```
`<h1>42</h1>`


Additionally, the `examples` directory shows a number of concrete use cases, e.g.

Expand All @@ -58,6 +48,8 @@ Additionally, the `examples` directory shows a number of concrete use cases, e.g
* [file upload](./examples/upload.hs)
* and more

You can run these using `cabal run scotty-exceptions`, `cabal run scotty-globalstate` etc.

## More Information

Tutorials and related projects can be found in the [Scotty wiki](https://github.com/scotty-web/scotty/wiki).
Expand Down

0 comments on commit c74073e

Please sign in to comment.