23 lines
581 B
Rust
23 lines
581 B
Rust
|
use actix_files as fs;
|
||
|
use actix_web::{App, HttpServer, middleware};
|
||
|
use env_logger;
|
||
|
|
||
|
mod relay;
|
||
|
|
||
|
#[actix_web::main]
|
||
|
async fn main() -> std::io::Result<()> {
|
||
|
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
|
||
|
|
||
|
HttpServer::new(|| {
|
||
|
App::new()
|
||
|
.wrap(middleware::Logger::default())
|
||
|
.configure(relay::configure)
|
||
|
.service(
|
||
|
fs::Files::new("/", "./public/")
|
||
|
.index_file("index.html")
|
||
|
)
|
||
|
})
|
||
|
.bind(("0.0.0.0", 8080))?
|
||
|
.run()
|
||
|
.await
|
||
|
}
|