blob: 7531b8811117114f134a41a413db94fc54e31f87 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
Static file handler example
===========================
To try this example, you need GNU `make` and `git` in your PATH.
To build the example, run the following command:
``` bash
$ make
```
To start the release in the foreground:
``` bash
$ ./_rel/bin/static_world_example console
```
The example will serve all the files found in the `priv`
directory. For example:
* [Plain text file](http://localhost:8080/test.txt)
* [HTML5 video demo](http://localhost:8080/video.html)
Example output
--------------
``` bash
$ curl -i http://localhost:8080/test.txt
HTTP/1.1 200 OK
connection: keep-alive
server: Cowboy
date: Mon, 09 Sep 2013 13:49:50 GMT
content-length: 52
content-type: text/plain
last-modified: Fri, 18 Jan 2013 16:33:31 GMT
If you read this then the static file server works!
```
|