0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
cowboy/examples/static_world
2016-01-14 20:56:31 +01:00
..
priv Add an index.html that is also served statically as the default for / 2015-05-06 11:50:11 +03:00
src Remove the .app.src file in all examples 2016-01-14 20:56:31 +01:00
Makefile Remove the .app.src file in all examples 2016-01-14 20:56:31 +01:00
README.asciidoc Simplify example instructions and fix broken examples 2016-01-14 20:00:50 +01:00
relx.config Convert the static handler example to a release 2013-09-09 15:51:41 +02:00

= Static file handler example

To try this example, you need GNU `make` and `git` in your PATH.

To build and run the example, use the following command:

[source,bash]
$ make run

The example will serve all the files found in the 'priv/'
directory. For example:

* http://localhost:8080/test.txt[Plain text file]
* http://localhost:8080/video.html[HTML5 video demo]

== Example output

[source,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!
----