Skip to content

Commit

Permalink
Update tryOnTeapot.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianconcept authored Jan 27, 2024
1 parent e2a3df4 commit 5582302
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tryOnTeapot.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Metacello new
load.
```

### Configure the server and setup routes
### Configure the server
```smalltalk
"Configure Teapot defaults"
teapot := Teapot configure: {
Expand All @@ -22,7 +22,9 @@ teapot exception: Error -> [ :ex :req | | content |
ifFalse: [ 'Internal error' ].
TeaResponse serverError body: content.
].
```
### Setup routes
```smalltalk
"Add a ping route"
teapot GET: '/ping' -> 'pong'.
Expand All @@ -41,4 +43,4 @@ teapot start.
"Stop the HTTP server."
teapot stop.
```
```

0 comments on commit 5582302

Please sign in to comment.