diff --git a/priv/basic.skel b/priv/basic.skel index 8495b6d..b5f1d07 100644 --- a/priv/basic.skel +++ b/priv/basic.skel @@ -8,33 +8,27 @@ {dir, "{{appid}}/apps/{{appid}}/src/view"}. {dir, "{{appid}}/apps/{{appid}}/src/view/layout"}. {dir, "{{appid}}/apps/{{appid}}/src/view/lib"}. -{dir, "{{appid}}/apps/{{appid}}/src/view/{{appid}}_index"}. -{dir, "{{appid}}/apps/{{appid}}/src/view/{{appid}}_error"}. +{dir, "{{appid}}/apps/{{appid}}/src/view/index"}. +{dir, "{{appid}}/apps/{{appid}}/src/view/error"}. + {dir, "{{appid}}/apps/{{appid}}/src/view/lib/tag_html"}. {dir, "{{appid}}/apps/{{appid}}/src/view/lib/tag_modules"}. {dir, "{{appid}}/apps/{{appid}}/src/view/lib/filter_modules"}. {dir, "{{appid}}/apps/{{appid}}/src/view/lib/custom_tags"}. {dir, "{{appid}}/apps/{{appid}}/priv"}. -{dir, "{{appid}}/apps/{{appid}}/priv/spa"}. -{dir, "{{appid}}/apps/{{appid}}/priv/templates"}. - -{template, "basic/rebar2.config", "{{appid}}/apps/{{appid}}/rebar.config"}. -{template, "basic/rebar1.config", "{{appid}}/apps/rebar.config"}. -{template, "basic/rebar.config", "{{appid}}/rebar.config"}. -{template, "basic/vm.args", "{{appid}}/vm.args"}. -{template, "basic/sys.config", "{{appid}}/sys.config"}. -{template, "basic/project.app.src", "{{appid}}/apps/{{appid}}/src/{{appid}}.app.src"}. -{template, "basic/project.erl", "{{appid}}/apps/{{appid}}/src/{{appid}}.erl"}. -{template, "basic/project_controller_index.erl", "{{appid}}/apps/{{appid}}/src/controller/index.erl"}. -{template, "basic/project_controller_error.erl", "{{appid}}/apps/{{appid}}/src/controller/error.erl"}. -{template, "basic/project_routes.erl", "{{appid}}/apps/{{appid}}/src/{{appid}}_routes.erl"}. -{template, "basic/project.routes", "{{appid}}/apps/{{appid}}/priv/{{appid}}.routes"}. -{file, "basic/project_view_layout_n2o.html", "{{appid}}/apps/{{appid}}/src/view/layout/n2o.html"}. -{file, "basic/project_view_layout_page.html", "{{appid}}/apps/{{appid}}/src/view/layout/page.html"}. -{file, "basic/project_view_index_hello.html", "{{appid}}/apps/{{appid}}/src/view/index/hello.html"}. -{file, "basic/project_view_error_404.html", "{{appid}}/apps/{{appid}}/src/view/error/404.html"}. -{file, "basic/project_priv_templates_index.html", "{{appid}}/apps/{{appid}}/priv/templates/index.html"}. -{file, "basic/project_priv_static_synrc.css", "{{appid}}/apps/{{appid}}/priv/static/synrc.css"}. -{file, "basic/project_priv_static_spa_index.htm", "{{appid}}/apps/{{appid}}/priv/static/spa/index.htm"}. +{template,"basic/apps/project/priv/project.routes","{{appid}}/apps/{{appid}}/priv/{{appid}}.routes"}. +{template,"basic/apps/project/rebar.config","{{appid}}/apps/{{appid}}/rebar.config"}. +{template,"basic/apps/project/src/project.app.src","{{appid}}/apps/{{appid}}/src/{{appid}}.app.src"}. +{template,"basic/apps/project/src/project.erl","{{appid}}/apps/{{appid}}/src/{{appid}}.erl"}. +{template,"basic/apps/rebar.config","{{appid}}/apps/rebar.config"}. +{template,"basic/rebar.config","{{appid}}/rebar.config"}. +{template,"basic/sys.config", "{{appid}}/sys.config"}. +{template,"basic/vm.args", "{{appid}}/vm.args"}. +{file,"basic/apps/project/src/controller/error.erl", "{{appid}}/apps/{{appid}}/src/controller/error.erl"}. +{file,"basic/apps/project/src/controller/index.erl", "{{appid}}/apps/{{appid}}/src/controller/index.erl"}. +{file,"basic/apps/project/src/view/error/404.html", "{{appid}}/apps/{{appid}}/src/view/error/404.html"}. +{file,"basic/apps/project/src/view/index/index.html","{{appid}}/apps/{{appid}}/src/view/index/index.html"}. +{file,"basic/apps/project/src/view/layout/n2o.html", "{{appid}}/apps/{{appid}}/src/view/layout/n2o.html"}. +{file,"basic/apps/project/src/view/layout/page.html","{{appid}}/apps/{{appid}}/src/view/layout/page.html"}. diff --git a/priv/basic/apps/project/priv/project.routes b/priv/basic/apps/project/priv/project.routes new file mode 100644 index 0000000..99a3f75 --- /dev/null +++ b/priv/basic/apps/project/priv/project.routes @@ -0,0 +1,34 @@ +[ +%% DISPATCH RULE: {"URL MATCH" , handler, opts()} + +%% cowboy static handler, here single file access. + { "/favicon.ico", cowboy_static, {priv_file, {{appid}}, "static/favicon.ico"}} + +%% naga static handler, support gz compression, just gzip your static file +%% you need to keep uncompressed version and a compression version in your static folder, according to client capabiliti +%% the according version will be serve either from disk or memory + ,{ "/n2o/[...]", naga_static, { dir, "deps/n2o/priv", [ { mimetypes, cow_mimetypes, all } ] }} + ,{ "/{{appid}}/static/[...]", naga_static, { dir, "deps/{{appid}}/priv", [ { mimetypes, cow_mimetypes, all } ] }} + +%% naga convenient handler. + ,{"/$v/[...]", naga_indexof, { {{appid}},view,"/$v"}} +%,{"/$c/[...]", naga_indexof, { {{appid}},controller,"/$c"}} + ,{"/$s/[...]", naga_indexof, { {{appid}},static,"/$s"}} + + + %% YOUR RULES: dispatch {url/path}|code => application/controller/action + %% no support for regex in url/path + %% app is default alias for application + %% ctrl is default alias for controller + %% act is default alias for action + %% you can redefine alias add in naga config section using + %% {def_application, a}, + %% {def_controller, c} + %% {def_action, ac} where a,c,ac are atom + + ,{ "/index", [{app, {{appid}} },{ctrl, index},{action,index}], []} + ,{ "/", [{app, {{appid}} },{ctrl, index},{action,index},{id, 42}], []} + + ,{ 404, [{application, {{appid}} },{controller, error}, {action, '404'}], []} + ,{ 500, [{application, {{appid}} },{controller, error}, {action, '500'}], []} +]. diff --git a/priv/basic/rebar2.config b/priv/basic/apps/project/rebar.config similarity index 100% rename from priv/basic/rebar2.config rename to priv/basic/apps/project/rebar.config diff --git a/priv/basic/project_controller_error.erl b/priv/basic/apps/project/src/controller/error.erl similarity index 100% rename from priv/basic/project_controller_error.erl rename to priv/basic/apps/project/src/controller/error.erl diff --git a/priv/basic/apps/project/src/controller/index.erl b/priv/basic/apps/project/src/controller/index.erl new file mode 100644 index 0000000..12cf89f --- /dev/null +++ b/priv/basic/apps/project/src/controller/index.erl @@ -0,0 +1,14 @@ +-module(index). +-export([index/3, event/1]). +-default_action(index). +-actions([index]). + +-include_lib("n2o/include/wf.hrl"). +-include_lib("nitro/include/nitro.hrl"). +-include_lib("naga/include/naga.hrl"). + +index(<<"GET">>, _, _) -> + {ok, [{msg, "Hello World!!!!! "}]}. + +event(Event) -> + wf:info(?MODULE,"Unknown Event: ~p~n",[Event]). \ No newline at end of file diff --git a/priv/basic/project.app.src b/priv/basic/apps/project/src/project.app.src similarity index 69% rename from priv/basic/project.app.src rename to priv/basic/apps/project/src/project.app.src index 88e5adf..65f8ed0 100644 --- a/priv/basic/project.app.src +++ b/priv/basic/apps/project/src/project.app.src @@ -1,6 +1,6 @@ {application, {{appid}}, - [{description, "my awesome {{appid}} "}, - {vsn, "0.2"}, + [{description, "{{desc}}"}, + {vsn, "{{vsn}}"}, {registered, []}, {applications, [kernel, stdlib, naga]}, {mod, { {{appid}}, []}}, diff --git a/priv/basic/project.erl b/priv/basic/apps/project/src/project.erl similarity index 100% rename from priv/basic/project.erl rename to priv/basic/apps/project/src/project.erl diff --git a/priv/basic/project_view_error_404.html b/priv/basic/apps/project/src/view/error/404.html similarity index 100% rename from priv/basic/project_view_error_404.html rename to priv/basic/apps/project/src/view/error/404.html diff --git a/priv/basic/project_view_index_hello.html b/priv/basic/apps/project/src/view/index/index.html similarity index 100% rename from priv/basic/project_view_index_hello.html rename to priv/basic/apps/project/src/view/index/index.html diff --git a/priv/basic/project_view_layout_n2o.html b/priv/basic/apps/project/src/view/layout/n2o.html similarity index 100% rename from priv/basic/project_view_layout_n2o.html rename to priv/basic/apps/project/src/view/layout/n2o.html diff --git a/priv/basic/project_view_layout_page.html b/priv/basic/apps/project/src/view/layout/page.html similarity index 100% rename from priv/basic/project_view_layout_page.html rename to priv/basic/apps/project/src/view/layout/page.html diff --git a/priv/basic/rebar1.config b/priv/basic/apps/rebar.config similarity index 100% rename from priv/basic/rebar1.config rename to priv/basic/apps/rebar.config diff --git a/priv/basic/project.routes b/priv/basic/project.routes deleted file mode 100644 index 35a0d6e..0000000 --- a/priv/basic/project.routes +++ /dev/null @@ -1,27 +0,0 @@ -[ -%% DISPATCH RULE: {"URL MATCH" , handler, opts()} - -%% cowboy static handler, here single file access. - { "/favicon.ico", cowboy_static, {priv_file, {{appid}}, "static/favicon.ico"}} - -%% n2o static handler, very usefull in bundle application where the static file are keept in memory - ,{ "/semantic/[...]", n2o_static, { dir, "deps/semantic_forms/priv", [ { mimetypes, cow_mimetypes, all } ] }} - ,{ "/n2o/[...]", n2o_static, { dir, "deps/n2o/priv", [ { mimetypes, cow_mimetypes, all } ] }} - ,{ "/naga/[...]", n2o_static, { dir, "deps/naga/priv", [ { mimetypes, cow_mimetypes, all } ] }} - -%% some naga convenient handler. -%% ,{ "/$c/[...]", naga_indexof, [{ {{appid}}, controller}] } %% indexof controller -%% ,{ "/$v/[...]", naga_indexof, [{ {{appid}}, view}] } %% indexof view - -%% Your Rest Api, your cowboy rest handler -%% ,{ "/OAuth/2/OwnerToken/[...]", my_oauth2_owner_token, [yourOption] } -%% ,{ "/OAuth/2/ClientToken/[...]", my_oauth2_client_token, [] } -%% ,{ "/OAuth/2/AccessToken/[...]", my_oauth2_access_token, [] } - - %% YOUR RULES: - ,{ "/index", [{application, {{appid}} },{controller, index },{action,index}], []} - ,{ "/", [{application, {{appid}} },{controller, index},{action,index},{id, 42}], []} - - ,{ 404, [{application, {{appid}} },{controller, error}, {action, '404'}], []} - ,{ 500, [{application, {{appid}} },{controller, error}, {action, '500'}], []} -]. diff --git a/priv/basic/project/src/controller/error.erl b/priv/basic/project/src/controller/error.erl new file mode 100644 index 0000000..66d0003 --- /dev/null +++ b/priv/basic/project/src/controller/error.erl @@ -0,0 +1,8 @@ +-module(error). +-compile(export_all). +-include_lib("n2o/include/wf.hrl"). +-include_lib("nitro/include/nitro.hrl"). + +'404'(_, _, _) -> {ok, [{msg, "404 Not Found"}]}. + +event(Event) -> wf:info(?MODULE,"Unknown Event: ~p~n",[Event]). diff --git a/priv/basic/project/src/controller/index.erl b/priv/basic/project/src/controller/index.erl new file mode 100644 index 0000000..12cf89f --- /dev/null +++ b/priv/basic/project/src/controller/index.erl @@ -0,0 +1,14 @@ +-module(index). +-export([index/3, event/1]). +-default_action(index). +-actions([index]). + +-include_lib("n2o/include/wf.hrl"). +-include_lib("nitro/include/nitro.hrl"). +-include_lib("naga/include/naga.hrl"). + +index(<<"GET">>, _, _) -> + {ok, [{msg, "Hello World!!!!! "}]}. + +event(Event) -> + wf:info(?MODULE,"Unknown Event: ~p~n",[Event]). \ No newline at end of file diff --git a/priv/basic/project/src/view/error/404.html b/priv/basic/project/src/view/error/404.html new file mode 100644 index 0000000..260fcaf --- /dev/null +++ b/priv/basic/project/src/view/error/404.html @@ -0,0 +1,4 @@ +{% extend "layout/page.html" %} +{% block body %} +{{msg}} +{% endblock %} diff --git a/priv/basic/project/src/view/index/index.html b/priv/basic/project/src/view/index/index.html new file mode 100644 index 0000000..02961b5 --- /dev/null +++ b/priv/basic/project/src/view/index/index.html @@ -0,0 +1,14 @@ +{% extends "layout/page.html" %} + +{% block body %} + {{msg}} +
+ {{_session_id}} +
+ {{_app}} +
+ {{_action}} +
+ {{_controller}} +{% endblock %} + diff --git a/priv/basic/project_priv_templates_index.html b/priv/basic/project/src/view/layout/n2o.html similarity index 72% rename from priv/basic/project_priv_templates_index.html rename to priv/basic/project/src/view/layout/n2o.html index 33e3e02..e8c4081 100644 --- a/priv/basic/project_priv_templates_index.html +++ b/priv/basic/project/src/view/layout/n2o.html @@ -1,20 +1,21 @@ - {{title}} -{{body}} - + hello layout n2o
+ {% block body %} {% endblock %} + - + - + + diff --git a/priv/basic/project/src/view/layout/page.html b/priv/basic/project/src/view/layout/page.html new file mode 100644 index 0000000..46c7b67 --- /dev/null +++ b/priv/basic/project/src/view/layout/page.html @@ -0,0 +1,10 @@ + + + +{{title}} + + + hello layout page
+ {% block body %} {% endblock %} + + \ No newline at end of file diff --git a/priv/basic/project_controller_index.erl b/priv/basic/project_controller_index.erl deleted file mode 100644 index 516d4e3..0000000 --- a/priv/basic/project_controller_index.erl +++ /dev/null @@ -1,50 +0,0 @@ --module(index). --compile(export_all). --include_lib("n2o/include/wf.hrl"). --include_lib("nitro/include/nitro.hrl"). --include_lib("naga/include/naga.hrl"). - -redirect(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION redirect executed",[]), - {redirect, "/hello"}. - -redirect_header(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION redirect_header executed",[]), - {redirect, "/hello", [{<<"X-NAGA-REDIRECT">>, <<"HELLO MAESTRO REDIRECT">>}]}. - -moved(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION moved executed",[]), - {moved, "/hello"}. - -moved_header(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION moved_header executed",[]), - {moved, "/hello", [{<<"X-NAGA-MOVED">>, <<"HELLO MAESTRO MOVED">>}]}. - -action_other(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION action_other executed",[]), - {action_other, #route{application={{appid}},controller=index,action=hello}}. - -render_other(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - wf:info(?MODULE,"ACTION render_other executed",[]), - {render_other, #route{application={{appid}},controller=index,action=hello}}. - - -hello(<<"GET">>, _, _) -> - Count = case wf:cache(count) of undefined -> 0; C -> C + 1 end, - wf:cache(count, Count), - {ok, [{msg, "Hello World!!!!! " ++ nitro:to_list(wf:cache(count))}]}. - -event(Event) -> - wf:info(?MODULE,"Unknown Event: ~p~n",[Event]). diff --git a/priv/basic/project_priv_static_spa_index.htm b/priv/basic/project_priv_static_spa_index.htm deleted file mode 100644 index 31560c8..0000000 --- a/priv/basic/project_priv_static_spa_index.htm +++ /dev/null @@ -1,21 +0,0 @@ - - - -N2O - - -
- - - - - - - - - - - - - - diff --git a/priv/basic/project_priv_static_synrc.css b/priv/basic/project_priv_static_synrc.css deleted file mode 100644 index d622646..0000000 --- a/priv/basic/project_priv_static_synrc.css +++ /dev/null @@ -1,3 +0,0 @@ -body { font: -webkit-small-control; font-size: 20pt; } -input { font-size: 18pt; padding: 10px; } -button { font-size:20pt; padding: 10px; margin-top: 2px; } diff --git a/priv/basic/project_routes.erl b/priv/basic/project_routes.erl deleted file mode 100644 index a7d6069..0000000 --- a/priv/basic/project_routes.erl +++ /dev/null @@ -1,34 +0,0 @@ --module({{appid}}_routes). --include_lib("n2o/include/wf.hrl"). --include_lib("deps/naga/include/naga.hrl"). - --export([init/2, finish/2]). - -finish(State, Ctx) -> {ok, State, Ctx}. -init(State, Ctx) -> - Req = Ctx#cx.req, - {Bindings, _} =cowboy_req:binding(bindings,Req), - {Controller,_}=cowboy_req:binding(controller,Req), - {Action,_} =cowboy_req:binding(action,Req), - {Method,_} =cowboy_req:method(Req), - {Params,_} =cowboy_req:path_info(Req), - - {C,A} = match(Controller,Action), - R = #{application => {{appid}}, - method => Method, - controller => C, %%module name - action => A, - params => Params, - bindings => Bindings - }, - %wf:info(?MODULE, "ROUTE ~p : ~p, ~p",[wf:path(Req), C, A]), - {ok, State, Ctx#cx{path=R,module=C}}. - -match(undefined ,undefined) -> {index ,hello}; -match(<<"redirect">> ,undefined) -> {index ,redirect}; -match(<<"redirect">> ,<<"header">>) -> {index ,redirect_header}; -match(<<"moved">> ,undefined) -> {index ,moved}; -match(<<"moved">> ,<<"header">>) -> {index ,moved_header}; -match(<<"action">> ,<<"other">>) -> {index ,hello}; -match(<<"hello">> ,undefined) -> {index ,hello}; -match(_,_) -> {error ,'404'}. diff --git a/priv/basic/rebar.config b/priv/basic/rebar.config index 741ddd7..73fec1d 100644 --- a/priv/basic/rebar.config +++ b/priv/basic/rebar.config @@ -1,7 +1,6 @@ {sub_dirs,["apps"]}. {deps_dir,"deps"}. -{deps, [ - {lager, ".*", {git, "https://github.com/basho/lager", {tag, "3.0.1"} }}, +{deps, [ {naga, ".*", {git, "git://github.com/naga-framework/naga", {tag, "master"} }} ]}. diff --git a/priv/basic/sys.config b/priv/basic/sys.config index bb9c6b4..5da1e24 100644 --- a/priv/basic/sys.config +++ b/priv/basic/sys.config @@ -1,40 +1,64 @@ -[{n2o, [{port, {{port}} }, - %{route,{{appid}}_routes}, - {log_modules, {{appid}} } +[{n2o, [ + {port, {{port}} } + ,{websocket_port, {{port}} } + ,{app, {{appid}} } + ,{upload, "/tmp"} + ,{session, n2o_session} + %,{auto_session, disabled} + ,{ttl, 900} %% time to live session 15mn, change according to your case + ,{mq, n2o_syn} + ,{formatter,bert} + ,{minify,{"apps/{{appid}}/priv/static", + ["deps/n2o/priv/bullet.js", + "deps/n2o/priv/n2o.js", + "deps/n2o/priv/ftp.js", + "deps/n2o/priv/protocols/bert.js", + "deps/n2o/priv/protocols/nitrogen.js", + "deps/n2o/priv/utf8.js", + "deps/n2o/priv/validation.js"]}} + ,{route, naga_routes} + ,{secret,<<"{{appid}}-This-IS-Classified-Change-Me">>} + ,{log_modules, {{appid}} } + %,{log_level, {{appid}} } + ,{log_backend, n2o_log} + + ,{origin,<<"*">>} + ,{bridge,n2o_cowboy} + ,{pickler,n2o_pickle} + ,{erroring,n2o_error} + ,{event,pickle} + ,{protocols,[ n2o_heart, + n2o_nitrogen, + n2o_file, + n2o_client + ]} ]}, -{naga, [ - {watch,[{{appid}}]} - ]}, + + { naga, [ + {watch,[{{appid}}]} + ]}, { {{appid}}, [ {domain, all} - %,{domains, ["www.{{appid}}.dev", ":sub.{{appid}}.dev"]} - ,{base_url, "/"} - ,{routes, {{appid}}_routes} + %,{domains, ["www.{{appid}}.dev", ":sub.{{appid}}.dev"]} + ,{mode, dev} + ,{rules,[routes,view]} %% use routes file and view routing + ,{base_url, "/"} + ,{lang_dir, "./priv/lang"} + ,{modules,[]} + ,{assume_locale, <<"en">>} + %,{theme, your_theme} + ,{i18n, false} + + ,{port, {{port}} } + ,{websocket_port, {{port}} } ,{listeners,[ {http, [ - {acceptors, 100},{ip,{0,0,0,0}},{port,8080} + {acceptors, 100},{ip,{0,0,0,0}},{port, {{port}} } ]} - %,{https, [ - % {acceptors, 100},{ip,{0,0,0,0}},{port,8433}, - % {ssl_opts,[ - % {cacertfile, "./etc/ssl/cowboy-ca.crt"}, - % {certfile, "./etc/ssl/server.crt"}, - % {keyfile, "./etc/ssl/server.key"} - % ]} - % ]}, - %,{spdy, [ - % {acceptors, 100},{ip,{0,0,0,0}},{port,9433}, - % {ssl_opts,[ - % {cacertfile, "./etc/ssl/cowboy-ca.crt"}, - % {certfile, "./etc/ssl/server.crt"}, - % {keyfile, "./etc/ssl/server.key"} - % ]} - % ]}, - ]} - ,{lang_dir, "./data/lang"} + ,{lang_dir, "./priv/lang"} %%,{filter_config,[ %% { {{appid}}_auth, []} %% ]} diff --git a/priv/bossdb/sys.config b/priv/bossdb/sys.config index 370e763..a1c7bee 100644 --- a/priv/bossdb/sys.config +++ b/priv/bossdb/sys.config @@ -1,5 +1,5 @@ [{n2o, [{port, {{port}} }, - %{route,{{appid}}_routes}, + {route,naga_routes}, {log_modules, {{appid}} } ]}, {naga, [ @@ -13,25 +13,8 @@ ,{assume_locale, <<"en">>} ,{listeners,[ {http, [ - {acceptors, 100},{ip,{0,0,0,0}},{port,8080} + {acceptors, 100},{ip,{0,0,0,0}},{port, {{port}} } ]} - %,{https, [ - % {acceptors, 100},{ip,{0,0,0,0}},{port,8433}, - % {ssl_opts,[ - % {cacertfile, "./etc/ssl/cowboy-ca.crt"}, - % {certfile, "./etc/ssl/server.crt"}, - % {keyfile, "./etc/ssl/server.key"} - % ]} - % ]}, - %,{spdy, [ - % {acceptors, 100},{ip,{0,0,0,0}},{port,9433}, - % {ssl_opts,[ - % {cacertfile, "./etc/ssl/cowboy-ca.crt"}, - % {certfile, "./etc/ssl/server.crt"}, - % {keyfile, "./etc/ssl/server.key"} - % ]} - % ]}, - ]} ,{lang_dir, "./data/lang"}