runs rustfmt, removes unused imports
This commit is contained in:
21
src/main.rs
21
src/main.rs
@@ -1,12 +1,9 @@
|
||||
extern crate lootalot_db;
|
||||
extern crate actix_web;
|
||||
extern crate dotenv;
|
||||
extern crate lootalot_db;
|
||||
|
||||
use actix_web::{fs, server, App, HttpRequest, Result};
|
||||
use std::env;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use actix_web::{server, App, Result, HttpRequest, fs };
|
||||
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
@@ -16,10 +13,14 @@ fn main() {
|
||||
let www_root: String = env::var("WWW_ROOT").expect("WWW_ROOT must be set");
|
||||
println!("serving files from: {}", &www_root);
|
||||
server::new(move || {
|
||||
App::new()
|
||||
.handler("/", fs::StaticFiles::new(www_root.clone()).unwrap().index_file("index.html"))
|
||||
App::new().handler(
|
||||
"/",
|
||||
fs::StaticFiles::new(www_root.clone())
|
||||
.unwrap()
|
||||
.index_file("index.html"),
|
||||
)
|
||||
})
|
||||
.bind("127.0.0.1:8088")
|
||||
.unwrap()
|
||||
.run();
|
||||
.bind("127.0.0.1:8088")
|
||||
.unwrap()
|
||||
.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user