use const api definitions

This commit is contained in:
Dietmar Maurer
2019-11-21 09:36:41 +01:00
parent e4a5ab8ddb
commit 255f378a1b
40 changed files with 2368 additions and 1974 deletions

View File

@ -1,6 +1,5 @@
use failure::*;
use futures::*;
use lazy_static::lazy_static;
use proxmox::tools::try_block;
@ -44,13 +43,9 @@ async fn run() -> Result<(), Error> {
}
let _ = csrf_secret(); // load with lazy_static
lazy_static!{
static ref ROUTER: Router = proxmox_backup::api2::router();
}
let config = ApiConfig::new(
buildcfg::JS_DIR, &ROUTER, RpcEnvironmentType::PRIVILEGED);
buildcfg::JS_DIR, &proxmox_backup::api2::ROUTER, RpcEnvironmentType::PRIVILEGED);
let rest_server = RestServer::new(config);
// http server future:
@ -87,6 +82,6 @@ async fn run() -> Result<(), Error> {
server.await?;
log::info!("done - exit server");
Ok(())
}