forked from jmug/stoatchat
Run rust fmt.
This commit is contained in:
30
src/main.rs
30
src/main.rs
@@ -1,31 +1,33 @@
|
||||
#![feature(proc_macro_hygiene, decl_macro)]
|
||||
#[macro_use] extern crate rocket;
|
||||
#[macro_use] extern crate rocket_contrib;
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
#[macro_use]
|
||||
extern crate rocket_contrib;
|
||||
|
||||
pub mod websocket;
|
||||
pub mod database;
|
||||
pub mod email;
|
||||
pub mod guards;
|
||||
pub mod routes;
|
||||
pub mod email;
|
||||
pub mod websocket;
|
||||
|
||||
use dotenv;
|
||||
use std::thread;
|
||||
use rocket_cors::AllowedOrigins;
|
||||
use std::thread;
|
||||
|
||||
fn main() {
|
||||
dotenv::dotenv().ok();
|
||||
database::connect();
|
||||
dotenv::dotenv().ok();
|
||||
database::connect();
|
||||
|
||||
thread::spawn(|| {
|
||||
websocket::launch_server();
|
||||
});
|
||||
thread::spawn(|| {
|
||||
websocket::launch_server();
|
||||
});
|
||||
|
||||
let cors = rocket_cors::CorsOptions {
|
||||
allowed_origins: AllowedOrigins::All,
|
||||
..Default::default()
|
||||
}.to_cors().unwrap();
|
||||
}
|
||||
.to_cors()
|
||||
.unwrap();
|
||||
|
||||
routes::mount(rocket::ignite())
|
||||
.attach(cors)
|
||||
.launch();
|
||||
routes::mount(rocket::ignite()).attach(cors).launch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user