Use master branch, ignore local db, and use CORS.

This commit is contained in:
Paul Makles
2020-12-28 13:40:37 +00:00
parent 6cfec0ee08
commit d171374aa1
5 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
Rocket.toml Rocket.toml
/target /target
**/*.rs.bk **/*.rs.bk
.mongo
.env .env

2
Cargo.lock generated
View File

@@ -1960,7 +1960,7 @@ dependencies = [
[[package]] [[package]]
name = "revolt" name = "revolt"
version = "0.2.11" version = "0.3.0-alpha"
dependencies = [ dependencies = [
"bcrypt", "bcrypt",
"bitfield", "bitfield",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "revolt" name = "revolt"
version = "0.2.11" version = "0.3.0-alpha"
authors = ["Paul Makles <paulmakles@gmail.com>"] authors = ["Paul Makles <paulmakles@gmail.com>"]
edition = "2018" edition = "2018"
@@ -12,9 +12,9 @@ many-to-many = "0.1.2"
#rauth = { git = "https://gitlab.insrt.uk/insert/rauth" } #rauth = { git = "https://gitlab.insrt.uk/insert/rauth" }
hive_pubsub = { version = "0.4.1", features = ["mongo"] } hive_pubsub = { version = "0.4.1", features = ["mongo"] }
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors" } rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket" } rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", branch = "master" }
rocket = { git = "https://github.com/SergioBenitez/Rocket", default-features = false } rocket = { git = "https://github.com/SergioBenitez/Rocket", branch = "master", default-features = false }
mongodb = { version = "1.1.1", features = ["tokio-runtime"], default-features = false } mongodb = { version = "1.1.1", features = ["tokio-runtime"], default-features = false }
once_cell = "1.4.1" once_cell = "1.4.1"

View File

@@ -36,9 +36,11 @@ async fn main() {
..Default::default() ..Default::default()
} }
.to_cors() .to_cors()
.unwrap(); .expect("Failed to create CORS.");
routes::mount(rocket::ignite()) routes::mount(rocket::ignite())
.mount("/", rocket_cors::catch_all_options_routes())
.manage(cors.clone())
.attach(cors) .attach(cors)
.launch() .launch()
.await .await

View File

@@ -7,7 +7,7 @@ use mongodb::bson::doc;
#[get("/")] #[get("/")]
pub async fn root() -> Response { pub async fn root() -> Response {
Response::Success(json!({ Response::Success(json!({
"revolt": "0.2.11", "revolt": "0.3.0-alpha",
"features": { "features": {
"registration": !*DISABLE_REGISTRATION, "registration": !*DISABLE_REGISTRATION,
"captcha": { "captcha": {