Skip to content

Commit

Permalink
Fixed templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Taure committed Feb 13, 2021
1 parent c67fd8b commit f22bdb0
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
3 changes: 2 additions & 1 deletion priv/templates/nova.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{dir, "{{name}}/src/controllers"}.
{dir, "{{name}}/src/views"}.

{template, "nova/sys.config", "{{name}}/config/sys.config"}.
{template, "nova/dev_sys.config", "{{name}}/config/dev_sys.config"}.
{template, "nova/prod_sys.config", "{{name}}/config/prod_sys.config"}.
{template, "nova/routes.erl", "{{name}}/priv/{{name}}.routes.erl"}.
{template, "nova/app.src", "{{name}}/src/{{name}}.app.src"}.
{template, "nova/app.erl", "{{name}}/src/{{name}}_app.erl"}.
Expand Down
24 changes: 24 additions & 0 deletions priv/templates/nova/dev_sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-

[
{kernel, [
{logger_level, debug},
{logger,
[{handler, default, logger_std_h,
#{ formatter => {logger_formatter, #{ }}}}]}
]},
{nova, [
{cowboy_configuration, #{
port => 8080
}},
{dev_mode, true},
{bootstrap_application, {{name}}}, %% Bootstraps the application
%% Plugins is written on form {RequestType, Module, Options, Priority}
%% Priority is that the lowest number is executed first
{plugins, [
{pre_http_request, nova_security_plugin, #{}, 0},
{pre_ws_upgrade, nova_security_plugin, #{}, 0}
]}
]}
%% Please change your app.src-file instead if you intend to add app-specific configurations
].
26 changes: 26 additions & 0 deletions priv/templates/nova/prod_sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-

[
{kernel, [
{logger_level, info},
{logger,
[{handler, default, logger_std_h,
#{level => error,
config => #{file => "log/erlang.log"}}},
]}
]},
{nova, [
{cowboy_configuration, #{
port => 8080
}},
{dev_mode, false},
{bootstrap_application, {{name}}}, %% Bootstraps the application
%% Plugins is written on form {RequestType, Module, Options, Priority}
%% Priority is that the lowest number is executed first
{plugins, [
{pre_http_request, nova_security_plugin, #{}, 0},
{pre_ws_upgrade, nova_security_plugin, #{}, 0}
]}
]}
%% Please change your app.src-file instead if you intend to add app-specific configurations
].
6 changes: 4 additions & 2 deletions priv/templates/nova/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{erl_opts, [debug_info]}.
{src_dirs, ["src", "src/controllers"]}.
{shell, [{config, "./config/sys.config"}]}.
{shell, [{config, "./config/dev_sys.config"}]}.

{erlydtl_opts, [{doc_root, "src/views"},
{recursive, true},
Expand All @@ -13,7 +13,7 @@
]}.

{deps, [
{nova, "0.6.1"}
nova
]}.


Expand All @@ -24,11 +24,13 @@
[{{name}}],
[{dev_mode, true},
{include_erts, false},
{sys_config, "./config/dev_sys.config"},
{extended_start_script, true}]},
{release, {"{{name}}-prod", "0.1.0"},
[{{name}}],
[{dev_mode, false},
{include_erts, true},
{sys_config, "./config/prod_sys.config"},
{extended_start_script, true}]}
]}.

Expand Down
4 changes: 2 additions & 2 deletions priv/templates/nova_lfe/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{deps, [
{lfe, {git, "http://github.com/rvirding/lfe", {branch, "develop"}}},
{logjam, {git, "https://github.com/lfex/logjam", {branch, "release/1.0.x"}}},
{nova, {git, "https://github.com/novaframework/nova.git", {branch, "master"}}}
nova
]}.

{plugins, [
Expand Down Expand Up @@ -55,4 +55,4 @@
{alias, [
{'make-routes', [
{lfe, confabulate, "--path=priv/*routes.lfe"}]}
]}.
]}.

0 comments on commit f22bdb0

Please sign in to comment.