src/api2/node: start node configuration api

This commit is contained in:
Dietmar Maurer
2019-01-23 13:05:32 +01:00
parent d15009c0ce
commit b2b3485d5f
7 changed files with 106 additions and 6 deletions

26
src/api2/node/time.rs Normal file
View File

@ -0,0 +1,26 @@
use failure::*;
use crate::tools;
use crate::api::schema::*;
use crate::api::router::*;
use serde_json::{json, Value};
fn get_time(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
Ok(json!({
"timezone": "Europe/Vienna",
"time": 1297163644,
"localtime": 1297163644,
}))
}
pub fn router() -> Router {
let route = Router::new()
.get(ApiMethod::new(
get_time,
ObjectSchema::new("Read server time and time zone settings.")));
route
}