Change to Actix Web

This commit is contained in:
GuilhermeWerner
2021-05-12 12:56:11 -03:00
parent 5a38931498
commit de74510671
8 changed files with 54 additions and 100 deletions

25
Source/Backend.rs Normal file
View File

@ -0,0 +1,25 @@
#![allow(non_snake_case)]
mod Controllers;
use actix_web::{middleware, App, HttpServer};
use std::env;
use std::io::Result;
use Controllers::Hello;
pub async fn Main() -> Result<()> {
env::set_var("FRAMEWORK_LOG_LEVEL", "debug");
Framework_Log::Init();
HttpServer::new(|| {
App::new()
.wrap(middleware::Logger::default())
.wrap(middleware::Compress::default())
.service(Hello::Index)
})
.bind("localhost:5000")?
.run()
.await
}