fix(dashboard): enable dashboard by default

This commit is contained in:
JimMoen 2021-12-17 10:53:10 +08:00
parent 7c8e452a3c
commit 3a3226fc78
1 changed files with 4 additions and 10 deletions

View File

@ -48,16 +48,10 @@ start_listeners() ->
'basicAuth' => #{type => http, scheme => basic}, 'basicAuth' => #{type => http, scheme => basic},
'bearerAuth' => #{type => http, scheme => bearer} 'bearerAuth' => #{type => http, scheme => bearer}
}}}, }}},
Dispatch = Dispatch = [ {"/", cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
case os:getenv("_EMQX_ENABLE_DASHBOARD") of , {"/static/[...]", cowboy_static, {priv_dir, emqx_dashboard, "www/static"}}
V when V =:= "true" orelse V =:= "1" -> , {'_', cowboy_static, {priv_file, emqx_dashboard, "www/index.html"}}
[{"/", 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()),