0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Convert the GET echo example to a release

This commit is contained in:
Loïc Hoguin 2013-09-07 22:26:40 +02:00
parent 340f0a5112
commit e2b11bbeed
7 changed files with 38 additions and 38 deletions

View file

@ -1,23 +1,28 @@
Cowboy GET Echo
===============
GET parameter echo example
==========================
To compile this example you need rebar in your PATH.
To try this example, you need GNU `make`, `git` and
[relx](https://github.com/erlware/relx) in your PATH.
Type the following command:
```
$ rebar get-deps compile
To build the example, run the following command:
``` bash
$ make
```
You can then start the Erlang node with the following command:
```
./start.sh
To start the release in the foreground:
``` bash
$ ./_rel/bin/get_echo_example console
```
Then point your browser to the indicated URL. You can change
the GET parameter to check that the handler is echoing properly.
Then point your browser at
[http://localhost:8080/?echo=hello](http://localhost:8080/?echo=hello).
You can replace the `echo` parameter with another to check
that the handler is echoing it back properly.
Example
-------
Example output
--------------
``` bash
$ curl -i "http://localhost:8080/?echo=saymyname"
@ -26,7 +31,7 @@ connection: keep-alive
server: Cowboy
date: Fri, 28 Sep 2012 04:09:04 GMT
content-length: 9
Content-Encoding: utf-8
content-type: text/plain; charset=utf-8
saymyname
```