chore(dashboard): enable by default (#5926)

This commit is contained in:
Zaiming (Stone) Shi 2021-10-14 15:05:02 +02:00 committed by GitHub
parent 40ab0064ae
commit c5b2bc86a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 11 deletions

View File

@ -47,17 +47,10 @@ start_listeners() ->
type => apiKey, type => apiKey,
name => "authorization", name => "authorization",
in => header}}}}, in => header}}}},
%% TODO: make it permanent when it's ready to release Dispatch = [{"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}},
Dispatch = {"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}},
case os:getenv("_EMQX_ENABLE_DASHBOARD") of {'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
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"}},
{'_', 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()),