Added system/info endpoint, implement tagging
This commit is contained in:
@@ -4,15 +4,16 @@ use actix_cors::Cors;
|
||||
use actix_web::{App, HttpServer, middleware::Logger, web};
|
||||
use dotenv::from_filename;
|
||||
use reqwest::Certificate;
|
||||
use crate::auth::hash;
|
||||
use crate::account::hash;
|
||||
use crate::users::{User, ADMIN_ROLE};
|
||||
|
||||
mod account;
|
||||
mod airports;
|
||||
mod auth;
|
||||
mod db;
|
||||
mod error;
|
||||
mod metars;
|
||||
mod scheduler;
|
||||
mod system;
|
||||
mod users;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -71,7 +72,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
let state = AppState { client };
|
||||
let host = "0.0.0.0";
|
||||
let port = env::var("API_PORT").unwrap_or("5000".to_string());
|
||||
let port = "5000";
|
||||
|
||||
let server = match HttpServer::new(move || {
|
||||
let cors = Cors::default()
|
||||
@@ -88,8 +89,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
web::scope("api")
|
||||
.configure(airports::init_routes)
|
||||
.configure(metars::init_routes)
|
||||
.configure(auth::init_routes)
|
||||
.configure(users::init_routes),
|
||||
.configure(account::init_routes)
|
||||
.configure(users::init_routes)
|
||||
.configure(system::init_routes),
|
||||
)
|
||||
})
|
||||
.bind(format!("{}:{}", host, port))
|
||||
|
||||
Reference in New Issue
Block a user