mirror of
https://github.com/guilhermewerner/rust-api
synced 2025-06-15 14:35:15 +00:00
26 lines
506 B
Rust
26 lines
506 B
Rust
#![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
|
|
}
|