1 extern crate lemmy_server;
3 extern crate diesel_migrations;
6 use lemmy_server::db::establish_connection;
7 use lemmy_server::routes::{federation, feeds, index, nodeinfo, webfinger, websocket};
8 use lemmy_server::settings::Settings;
13 let _ = env_logger::init();
14 let sys = actix::System::new("lemmy");
16 // Run the migrations from code
17 let conn = establish_connection();
18 embedded_migrations::run(&conn).unwrap();
20 let settings = Settings::get();
22 // Create Http server with websocket support
23 HttpServer::new(move || {
25 .configure(federation::config)
26 .configure(feeds::config)
27 .configure(index::config)
28 .configure(nodeinfo::config)
29 .configure(webfinger::config)
30 .configure(websocket::config)
31 .service(actix_files::Files::new(
33 settings.front_end_dir.to_owned(),
36 .bind((settings.bind, settings.port))
40 println!("Started http server at {}:{}", settings.bind, settings.port);