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

@ -16,11 +16,14 @@ fn get_network_config(
Ok(json!({}))
}
pub fn router() -> Router {
Router::new()
.get(ApiMethod::new(
get_network_config,
ObjectSchema::new("Read network configuration.")
.required("node", NODE_SCHEMA.clone())
))
}
pub const ROUTER: Router = Router::new()
.get(
&ApiMethod::new(
&ApiHandler::Sync(&get_network_config),
&ObjectSchema::new(
"Read network configuration.",
&[ ("node", false, &NODE_SCHEMA) ],
)
)
);