chore(dashboard): Allow test mode of the dashboard

This commit is contained in:
Zaiming Shi 2021-09-30 09:27:21 +02:00
parent be123f613d
commit e9991dca02
1 changed files with 11 additions and 7 deletions

View File

@ -47,13 +47,17 @@ start_listeners() ->
type => apiKey, type => apiKey,
name => "authorization", name => "authorization",
in => header}}}}, in => header}}}},
%% TODO: open dashboard after beta 1 %% TODO: make it permanent when it's ready to release
%% 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"}},
Dispatch = [], {'_', 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()),