Basic create user account
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user