0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00
cowboy/examples/static_world
2013-10-14 16:05:19 +02:00
..
priv Rename example 'static' to 'static_world' to avoid confusion 2013-01-30 22:13:31 +01:00
src Fix the list of registered processes in the examples 2013-09-09 16:46:21 +02:00
Makefile erlang.mk now has built-in support for relx 2013-10-14 16:05:19 +02:00
README.md Fix command to start the static_world release 2013-09-09 15:56:02 +02: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, git and relx in your PATH.

To build the example, run the following command:

$ make

To start the release in the foreground:

$ ./_rel/bin/static_world_example console

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

Example output

$ 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!