how to setup cowboy with rebar3
Asked Answered
A

1

11

I am a newbie of erlang/cowboy, using rebar3 now, as 99's cowboy is using its own erlang.mk system, how can I use rebar3 to build a cowboy release? Thank you in advance.

Abram answered 2/2, 2016 at 7:44 Comment(0)
L
8

Use the new command to create your project.

$ rebar3 new app yourapp

Then in your project path find rebar.config file and add cowboy as dependencie under the deps key:

{deps, 
    [{cowboy, {git, "git://github.com/ninenines/cowboy.git", {tag, "1.0.1"}}}]}.

Then using compile command rebar3 fetch defined dependencies and compile them as well as your application.

rebar3 compile

At the end for making a release you first need to create your release structure and then making a release with following commands.

$ rebar3 new release yourrel
$ rebar3 release

Note that basic usage example of Rebar3 is about cowboy in details.

Leukoderma answered 2/2, 2016 at 7:57 Comment(2)
the problem is more linked to, for example - handler.erl in cowboy as handlers are created by eralng.mk system, how it be convert to rebar3 template? Thank you in adavance.Abram
I am in the same position as perigee (almost 4 years later). How do you import the cowboy package into "myrel_app.erl" and start putting routes together? Following the rebar3 and cowboy tutorials alone is not quite enough for erlang beginners looking for an easy win (Though, I've been working on reading LYSE for a month or more bit by bit). I'll keep trying to figure it out on my own and such, but for now, this answer is not sufficient.Sartain

© 2022 - 2024 — McMap. All rights reserved.