chore(dashboard): disable by default

This commit is contained in:
zhouzb 2021-11-22 22:23:06 +08:00
parent c137c2eab5
commit 63f1d88ed3
1 changed files with 10 additions and 4 deletions

View File

@ -49,10 +49,16 @@ start_listeners() ->
type => 'apiKey', type => 'apiKey',
name => "authorization", name => "authorization",
in => header}}}}, in => header}}}},
Dispatch = [{"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}, Dispatch =
case os:getenv("_EMQX_ENABLE_DASHBOARD") of
V when V =:= "true" orelse V =:= "1" ->
[{"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}},
{"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}}, {"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}},
{'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}} {'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
], ];
_ ->
[]
end,
BaseMinirest = #{ BaseMinirest = #{
base_path => ?BASE_PATH, base_path => ?BASE_PATH,
modules => minirest_api:find_api_modules(apps()), modules => minirest_api:find_api_modules(apps()),