diff options
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r-- | src/routes/start.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/routes/start.rs b/src/routes/start.rs index d16ea4e..163d58c 100644 --- a/src/routes/start.rs +++ b/src/routes/start.rs | |||
@@ -12,6 +12,7 @@ use crate::db::Device; | |||
12 | use crate::error::WebolError; | 12 | use crate::error::WebolError; |
13 | 13 | ||
14 | pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap, Json(payload): Json<StartPayload>) -> Result<Json<Value>, WebolError> { | 14 | pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap, Json(payload): Json<StartPayload>) -> Result<Json<Value>, WebolError> { |
15 | info!("POST request"); | ||
15 | let secret = headers.get("authorization"); | 16 | let secret = headers.get("authorization"); |
16 | if auth(secret).map_err(WebolError::Auth)? { | 17 | if auth(secret).map_err(WebolError::Auth)? { |
17 | let device = sqlx::query_as!( | 18 | let device = sqlx::query_as!( |
@@ -28,7 +29,7 @@ pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap | |||
28 | 29 | ||
29 | let bind_addr = SETTINGS | 30 | let bind_addr = SETTINGS |
30 | .get_string("bindaddr") | 31 | .get_string("bindaddr") |
31 | .map_err(|err| WebolError::Server(Box::new(err)))?; | 32 | .unwrap_or("0.0.0.0:1111".to_string()); |
32 | 33 | ||
33 | let _ = send_packet( | 34 | let _ = send_packet( |
34 | &bind_addr.parse().map_err(|err| WebolError::Server(Box::new(err)))?, | 35 | &bind_addr.parse().map_err(|err| WebolError::Server(Box::new(err)))?, |