rebar3を使ってcowboyのアプリケーションを作成,ソースコード
$ rebar3 new release echo_get
$ cd echo_get
echo_get
のrebar.config
ファイルのdeps部分をcowobyを入れる
{deps, [
{cowboy, {git, "git://github.com/ninenines/cowboy.git", {tag, "1.0.4"}}}
}.
apps/echo_get/src/echo_get.app.src
のapplication
部分をcowboyを追加
{applications,
[kernel,
stdlib,
cowboy
]},
リリースを作成
rebar3 release
_build/default/rel/echo_get/bin/echo_get start
_build/default/rel/echo_get/bin/echo_get stop
_build/default/rel/echo_get/bin/echo_get console
使用例
$ curl -i "http://localhost:8080/?echo=こんにちは"
HTTP/1.1 200 OK
server: Cowboy
date: Sat, 09 Apr 2016 15:38:04 GMT
content-length: 15
content-type: text/plain; charset=utf-8
こんにちは
rebar3 shell
を使って,shellに入って, observer:start().
が使える
rebar3 shell