routes: use rocket_cors crate to handle CORS
Signed-off-by: ATechnoHazard <amolele@gmail.com>
This commit is contained in:
5 files changed
+50
-11
No files matched your search
@@ -1,5 +1,5 @@
|
||||
use crate::api::fairings::cors::CORS;
|
||||
use rocket::Rocket;
|
||||
use rocket_cors::CorsOptions;
|
||||
|
||||
pub mod health;
|
||||
pub mod paste;
|
||||
@@ -8,8 +8,9 @@ pub mod user;
|
||||
|
||||
pub fn fuel(rocket: Rocket) -> Rocket {
|
||||
let mut rocket = rocket;
|
||||
let cors = CorsOptions::default().to_cors().unwrap();
|
||||
rocket = health::fuel(rocket);
|
||||
rocket = paste::fuel(rocket);
|
||||
rocket = user::fuel(rocket);
|
||||
rocket.attach(CORS())
|
||||
rocket.attach(cors)
|
||||
}
|
||||
+7
-7
@@ -1,28 +1,28 @@
|
||||
#![feature(proc_macro_hygiene, decl_macro)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
extern crate rocket_contrib;
|
||||
#[macro_use]
|
||||
extern crate diesel;
|
||||
#[macro_use]
|
||||
extern crate diesel_migrations;
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
extern crate rocket_contrib;
|
||||
#[macro_use]
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate serde_json;
|
||||
#[macro_use]
|
||||
extern crate slog;
|
||||
|
||||
use slog::{Drain, Logger};
|
||||
use slog_async;
|
||||
use slog_term;
|
||||
|
||||
pub mod api;
|
||||
pub mod core;
|
||||
pub mod schema;
|
||||
pub mod utils;
|
||||
|
||||
use slog::{Drain, Logger};
|
||||
use slog_async;
|
||||
use slog_term;
|
||||
|
||||
embed_migrations!("migrations");
|
||||
|
||||
fn run_migrations(logger: &Logger) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use jirachi::Jirachi;
|
||||
use jirachi::collision_resistant::Jirachi;
|
||||
use jirachi::Wishable;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user