Basic create user account

This commit is contained in:
2023-05-24 16:19:46 +02:00
parent 9912428fd6
commit 0bfdc305b1
15 changed files with 224 additions and 8 deletions

View File

@ -1,6 +1,8 @@
use actix_remote_ip::RemoteIPConfig;
use actix_web::middleware::Logger;
use actix_web::{web, App, HttpServer};
use geneit_backend::app_config::AppConfig;
use geneit_backend::controllers::config_controller;
use geneit_backend::controllers::{auth_controller, config_controller};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
@ -10,12 +12,21 @@ async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.wrap(Logger::default())
.app_data(web::Data::new(RemoteIPConfig {
proxy: AppConfig::get().proxy_ip.clone(),
}))
// Config controller
.route("/", web::get().to(config_controller::home))
.route(
"/config/static",
web::get().to(config_controller::static_config),
)
// Auth controller
.route(
"/auth/create_account",
web::post().to(auth_controller::create_account),
)
})
.bind(AppConfig::get().listen_address.as_str())?
.run()