Added docker building.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use actix_web::{web::Data, App, HttpServer};
|
||||
use actix_web::{dev::Server, web::Data, App, HttpServer};
|
||||
|
||||
use crate::args::ServerConfig;
|
||||
|
||||
use super::routes::{healthcheck, index, login};
|
||||
|
||||
pub async fn start(args: ServerConfig, token: Arc<RwLock<Option<String>>>) -> anyhow::Result<()> {
|
||||
pub fn create(args: ServerConfig, token: Arc<RwLock<Option<String>>>) -> anyhow::Result<Server> {
|
||||
let addr = (args.host.clone(), args.port);
|
||||
HttpServer::new(move || {
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.wrap(actix_web::middleware::Logger::new(
|
||||
"\"%r\" \"-\" \"%s\" \"%a\" \"%D\"",
|
||||
@ -23,7 +23,6 @@ pub async fn start(args: ServerConfig, token: Arc<RwLock<Option<String>>>) -> an
|
||||
})
|
||||
.bind(addr)?
|
||||
.workers(1)
|
||||
.run()
|
||||
.await?;
|
||||
Ok(())
|
||||
.run();
|
||||
Ok(server)
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ mod routes;
|
||||
mod schema;
|
||||
mod templates;
|
||||
|
||||
pub use main::start;
|
||||
pub use main::create;
|
||||
|
Reference in New Issue
Block a user