Can build central in production mode
This commit is contained in:
@ -6,6 +6,7 @@ use crate::server::auth_middleware::AuthChecker;
|
||||
use crate::server::devices_api::{mgmt_controller, utils_controller};
|
||||
use crate::server::unsecure_server::*;
|
||||
use crate::server::web_api::*;
|
||||
use crate::server::web_app_controller;
|
||||
use actix_cors::Cors;
|
||||
use actix_identity::config::LogoutBehaviour;
|
||||
use actix_identity::IdentityMiddleware;
|
||||
@ -105,7 +106,7 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
|
||||
.app_data(web::Data::new(RemoteIPConfig {
|
||||
proxy: AppConfig::get().proxy_ip.clone(),
|
||||
}))
|
||||
.route("/", web::get().to(server_controller::secure_home))
|
||||
//.route("/", web::get().to(server_controller::secure_home))
|
||||
// Web API
|
||||
// Server controller
|
||||
.route(
|
||||
@ -181,6 +182,13 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
|
||||
"/devices_api/mgmt/get_certificate",
|
||||
web::get().to(mgmt_controller::get_certificate),
|
||||
)
|
||||
// Web app
|
||||
.route("/", web::get().to(web_app_controller::root_index))
|
||||
.route(
|
||||
"/assets/{tail:.*}",
|
||||
web::get().to(web_app_controller::serve_assets_content),
|
||||
)
|
||||
.route("/{tail:.*}", web::get().to(web_app_controller::root_index))
|
||||
})
|
||||
.bind_openssl(&AppConfig::get().listen_address, builder)?
|
||||
.run()
|
||||
|
Reference in New Issue
Block a user