Skip to content

Commit 8ecf018

Browse files
committed
Document http.serve
1 parent 46314a3 commit 8ecf018

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ I began building Ari to replicate the experience described in the [Background](#
7676

7777
## Examples
7878

79+
### Minimal HTTP Server
80+
81+
```
82+
"localhost:1234"http.serve{say x; ..[status:200;bodystring:"OK"]}
83+
```
84+
7985
### Slack API
8086

8187
Use Slack's API to get all messages in a channel for last 30 days. The first five lines set up the HTTP client specifically for Slack; the second block shows a code comment which can be evaluated to see a list of channels from which to pick the ID you need; the third block of code sets up the starting and ending timestamps with which to call the Slack API and a recursive function to fetch messages; the final line defines an `allmsgs` global with all messages from the given channel for the given time range, and then returns `"ok"` when it completes.

ari.goal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ tt.repsut:{[suite]
8282
tt.report:{
8383
tt.repsut'!tt.st; (tes;tfs;tps;tss):+/#''. .'tt.st; say "Total $tss succeeded, $tfs failed, $tes errored, $tps panicked"
8484
and[|//@[;!"es fs ps"]'#''tt.st;error["Tests failed."]]}
85+
/ Documentation
86+
"http.serve"help"hostAndPort http.serve handlerFn"
8587
1

0 commit comments

Comments
 (0)