Created
May 17, 2013 16:08
-
-
Save ToJans/5600132 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set path=%path%;c:\Program Files\erl5.10.1\bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/basho/rebar.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\Dev\erlang\rebar>rebar -c | |
clean Clean | |
compile Compile sources | |
escriptize Generate escript archive | |
create template= [var=foo,...] Create skel based on template and vars | |
create-app [appid=myapp] Create simple app skel | |
create-node [nodeid=mynode] Create simple node skel | |
list-templates List available templates | |
doc Generate Erlang program documentation | |
check-deps Display to be fetched dependencies | |
get-deps Fetch dependencies | |
update-deps Update fetched dependencies | |
----><8------- cut for brevity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\Dev\erlang\erlcdemo>rebar create-app appid=helloworld | |
==> erlcdemo (create-app) | |
Writing src/helloworld.app.src | |
Writing src/helloworld_app.erl | |
Writing src/helloworld_sup.erl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(helloworld). | |
-compile(export_all). | |
hi() -> | |
hi("stranger"). | |
hi("Tom") -> | |
hi("silly sod"); | |
hi(Who) -> | |
io:format("Hello ~s!~n",[Who]). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(helloworld). | |
-compile(export_all). | |
start() -> | |
application:start(crypto), | |
application:start(ranch), | |
application:start(cowboy), | |
axiom:start(?MODULE). | |
% Hi url without parameter | |
handle(<<"GET">>, [<<"hi">>], _Req) -> | |
hi(); | |
% Hi url with parameter | |
handle(<<"GET">>, [<<"hi">>, Name], _Req) -> | |
hi(Name). | |
hi() -> | |
hi("stranger"). | |
hi(<<"Tom">>) -> | |
hi("silly sod"); | |
hi(Who) -> | |
FormattedList = io_lib:format("<h1>Hello ~s!</h1>~n",[Who]), | |
erlang:iolist_to_binary(FormattedList). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment