Update lib.rs to use rocket 0.5

This commit is contained in:
notplants 2021-11-02 17:14:15 +01:00
parent a48838ad1d
commit 211c923454
3 changed files with 1133 additions and 312 deletions

1435
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ log = "0.4"
nest = "1.0.0"
peach-lib = { path = "../peach-lib" }
percent-encoding = "2.1.0"
rocket = "0.4.6"
rocket = "0.5.0-rc.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
snafu = "0.6"

View File

@ -39,7 +39,7 @@ use std::{env, thread};
use log::{debug, error, info};
use rocket::{catchers, routes};
use rocket::{catchers, routes, Rocket, Build};
use rocket_contrib::templates::Template;
use crate::routes::authentication::*;
@ -57,8 +57,8 @@ use crate::ws::*;
pub type BoxError = Box<dyn std::error::Error>;
// create rocket instance & mount web & json routes (makes testing easier)
fn rocket() -> rocket::Rocket {
rocket::ignite()
fn rocket() -> Rocket<Build> {
rocket::build()
.mount(
"/",
routes![
@ -128,7 +128,7 @@ fn rocket() -> rocket::Rocket {
reset_password_form_endpoint, // JSON API
],
)
.register(catchers![not_found, internal_error])
.register("/", catchers![not_found, internal_error])
.attach(Template::fairing())
}