1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
fedihub-website/src/main.rs

30 lines
638 B
Rust
Raw Normal View History

2020-10-14 20:36:24 +00:00
#![feature(decl_macro, proc_macro_hygiene)]
2020-10-13 23:40:03 +00:00
2020-10-14 22:42:08 +00:00
pub mod config;
2020-10-14 21:47:16 +00:00
mod database;
2020-10-14 21:54:19 +00:00
mod routes;
2020-10-14 21:28:09 +00:00
mod schema;
2020-10-14 21:48:53 +00:00
mod models;
2020-10-14 23:53:24 +00:00
mod forms;
2020-10-14 21:28:09 +00:00
#[macro_use] extern crate diesel;
2020-10-13 23:40:03 +00:00
#[macro_use] extern crate rocket;
2020-10-14 00:13:00 +00:00
#[macro_use] extern crate serde_derive;
2020-10-14 20:27:21 +00:00
2020-10-14 00:13:00 +00:00
extern crate rocket_contrib;
2020-10-13 23:40:03 +00:00
2020-10-14 00:01:25 +00:00
use rocket_contrib::templates::Template;
2020-10-14 00:26:03 +00:00
fn main() {
2020-10-14 22:42:08 +00:00
let config = config::Config::default().unwrap();
rocket(config).launch();
2020-10-14 00:27:00 +00:00
}
2020-10-14 22:42:08 +00:00
fn rocket(config: config::Config) -> rocket::Rocket {
rocket::custom(config.to_rocket_config().unwrap())
2020-10-14 22:51:17 +00:00
.manage(database::create_db_pool(config))
2020-10-14 00:26:03 +00:00
.attach(Template::fairing())
2020-10-14 21:54:19 +00:00
.mount("/", routes::routes())
2020-10-13 23:40:03 +00:00
}