()
| 141 | |
| 142 | #[tokio::main] |
| 143 | async fn start() -> Result<(), rocket::Error> { |
| 144 | rocket::build() |
| 145 | .attach(Db::init()) |
| 146 | .attach(AdHoc::try_on_ignite("Migrations", run_migrations)) |
| 147 | .mount("/", FileServer::from(relative!("/static"))) |
| 148 | .mount( |
| 149 | "/", |
| 150 | routes![new, create, delete, destroy, list, edit, update], |
| 151 | ) |
| 152 | .register("/", catchers![not_found]) |
| 153 | .attach(Template::fairing()) |
| 154 | .launch() |
| 155 | .await |
| 156 | .map(|_| ()) |
| 157 | } |
| 158 | |
| 159 | pub fn main() { |
| 160 | let result = start(); |