Skip to content

Commit 38ea219

Browse files
committed
Added more prose to the README so that it's not entirely comment-less code snippets.
1 parent 27e5eec commit 38ea219

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
WIP: Implementing the webstack in Julia.
22

3-
Simple HTTP hello world:
3+
## Dependencies
4+
5+
* Julia, since it's that's what it's all written in.
6+
7+
##Simple HTTP hello world:
8+
9+
If you want to handle things at the level of just
10+
HTTP requests and responses, this is a simple example
11+
of returning "Hello <name>!" only on "/hello/<name>" paths,
12+
and a 404 on all others.
13+
14+
Put it in a file called `http.jl` and then use the command `julia http.jl` to run it.
15+
If you open `localhost:8000/hello/user`, you'll get to see the server say hello.
416

517
```.jl
618
using Http
@@ -16,7 +28,19 @@ server = Server( http )
1628
run( server, 8000 )
1729
```
1830

19-
Middleware using `Meddle`:
31+
##Middleware using `Meddle`:
32+
33+
This is an example of using our middleware framework, Meddle.
34+
It puts each request through a "stack" of handlers,
35+
each of which can modify the request and/or response objects.
36+
37+
This particular example is a file server.
38+
It will serve files from the directory you run it in,
39+
and respond with `404`s if you give an invalid path.
40+
41+
Put it in a file called `meddle.jl` and then use the command `julia meddle.jl` to run it.
42+
If you run it from inside your `webstack.jl` folder,
43+
you could then open `localhost:8000/examples/meddle.jl` to have it serve its own code to you.
2044

2145
```.jl
2246
using Http
@@ -37,4 +61,4 @@ run( server, 8000 )
3761

3862
[Never graduate][HS].
3963

40-
[HS]: https://www.hackerschool.com
64+
[HS]: https://www.hackerschool.com

0 commit comments

Comments
 (0)