Bring back rocket_okapi support (#2136)
This commit is contained in:
parent
a5b3759e96
commit
b1f0a81672
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@ -243,7 +243,7 @@ jobs:
|
|||||||
examples/poem_example,
|
examples/poem_example,
|
||||||
examples/proxy_gluesql_example,
|
examples/proxy_gluesql_example,
|
||||||
examples/rocket_example,
|
examples/rocket_example,
|
||||||
# examples/rocket_okapi_example,
|
examples/rocket_okapi_example,
|
||||||
examples/salvo_example,
|
examples/salvo_example,
|
||||||
examples/seaography_example,
|
examples/seaography_example,
|
||||||
examples/tonic_example,
|
examples/tonic_example,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Rocket and Rocket-API with SeaORM example app
|
# Rocket and Rocket-API with SeaORM example app
|
||||||
|
|
||||||
1. Modify the `url` var in `api/Rocket.toml` to point to your chosen database
|
1. Modify the `url` var in `api/Rocket.toml` to point to your chosen database (or leave it as-is to use in-memory SQLite)
|
||||||
|
|
||||||
1. Turn on the appropriate database feature for your chosen db in `service/Cargo.toml` (the `"sqlx-postgres",` line)
|
1. If not using the SQLite DB: turn on the appropriate database feature for your chosen db in `service/Cargo.toml` (the `"sqlx-postgres",` line)
|
||||||
|
|
||||||
1. Execute `cargo run` to start the server
|
1. Execute `cargo run` to start the server
|
||||||
|
|
||||||
|
@ -8,4 +8,8 @@ template_dir = "api/templates/"
|
|||||||
|
|
||||||
# Postgres
|
# Postgres
|
||||||
# make sure to enable "sqlx-postgres" feature in Cargo.toml, i.e default = ["sqlx-postgres"]
|
# make sure to enable "sqlx-postgres" feature in Cargo.toml, i.e default = ["sqlx-postgres"]
|
||||||
url = "postgres://user:pass@localhost:5432/rocket"
|
# url = "postgres://user:pass@localhost:5432/rocket"
|
||||||
|
|
||||||
|
# SQLite
|
||||||
|
# make sure to enable "sqlx-sqlite" feature in Cargo.toml, i.e default = ["sqlx-sqlite"]
|
||||||
|
url = "sqlite::memory:"
|
||||||
|
@ -12,7 +12,9 @@ rocket-okapi-example-service = { path = "../service" }
|
|||||||
futures = { version = "0.3" }
|
futures = { version = "0.3" }
|
||||||
futures-util = { version = "0.3" }
|
futures-util = { version = "0.3" }
|
||||||
rocket = { version = "0.5.0", features = ["json"] }
|
rocket = { version = "0.5.0", features = ["json"] }
|
||||||
|
rocket_cors = "0.6.0"
|
||||||
rocket_dyn_templates = { version = "0.1.0-rc.1", features = ["tera"] }
|
rocket_dyn_templates = { version = "0.1.0-rc.1", features = ["tera"] }
|
||||||
|
rocket_okapi = { version = "0.8.0", features = ["swagger", "rapidoc", "rocket_db_pools"] }
|
||||||
serde_json = { version = "1" }
|
serde_json = { version = "1" }
|
||||||
entity = { path = "../entity" }
|
entity = { path = "../entity" }
|
||||||
migration = { path = "../migration" }
|
migration = { path = "../migration" }
|
||||||
@ -26,12 +28,3 @@ features = [
|
|||||||
"rocket_okapi",
|
"rocket_okapi",
|
||||||
] # enables rocket_okapi so to have open api features enabled
|
] # enables rocket_okapi so to have open api features enabled
|
||||||
# version = "0.5"
|
# version = "0.5"
|
||||||
|
|
||||||
[dependencies.rocket_okapi]
|
|
||||||
version = "0.8.0-rc.2"
|
|
||||||
features = ["swagger", "rapidoc", "rocket_db_pools"]
|
|
||||||
|
|
||||||
[dependencies.rocket_cors]
|
|
||||||
git = "https://github.com/lawliet89/rocket_cors.git"
|
|
||||||
rev = "54fae070"
|
|
||||||
default-features = false
|
|
||||||
|
@ -11,7 +11,6 @@ use crate::pool;
|
|||||||
use pool::Db;
|
use pool::Db;
|
||||||
|
|
||||||
pub use entity::post;
|
pub use entity::post;
|
||||||
pub use entity::post::Entity as Post;
|
|
||||||
|
|
||||||
use rocket_okapi::settings::OpenApiSettings;
|
use rocket_okapi::settings::OpenApiSettings;
|
||||||
|
|
||||||
|
@ -15,4 +15,4 @@ rocket = { version = "0.5.0", features = ["json"] }
|
|||||||
path = "../entity"
|
path = "../entity"
|
||||||
|
|
||||||
[dependencies.rocket_okapi]
|
[dependencies.rocket_okapi]
|
||||||
version = "0.8.0-rc.2"
|
version = "0.8.0"
|
||||||
|
@ -16,4 +16,4 @@ path = "../../../" # remove this line in your own project
|
|||||||
version = "1.0.0-rc.1" # sea-orm version
|
version = "1.0.0-rc.1" # sea-orm version
|
||||||
|
|
||||||
[dependencies.rocket_okapi]
|
[dependencies.rocket_okapi]
|
||||||
version = "0.8.0-rc.2"
|
version = "0.8.0"
|
||||||
|
@ -13,9 +13,9 @@ path = "../../../" # remove this line in your own project
|
|||||||
version = "1.0.0-rc.1" # sea-orm version
|
version = "1.0.0-rc.1" # sea-orm version
|
||||||
features = [
|
features = [
|
||||||
"runtime-tokio-native-tls",
|
"runtime-tokio-native-tls",
|
||||||
"sqlx-postgres",
|
# "sqlx-postgres",
|
||||||
# "sqlx-mysql",
|
# "sqlx-mysql",
|
||||||
# "sqlx-sqlite",
|
"sqlx-sqlite",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -20,15 +20,12 @@ default-features = false
|
|||||||
path = "../codegen"
|
path = "../codegen"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
|
|
||||||
# [dependencies.rocket_okapi]
|
[dependencies.rocket_okapi]
|
||||||
# version = "0.8.0-rc.4"
|
version = "0.8.0"
|
||||||
# default-features = false
|
default-features = false
|
||||||
# optional = true
|
optional = true
|
||||||
|
|
||||||
[dev-dependencies.rocket]
|
[dev-dependencies.rocket]
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["json"]
|
features = ["json"]
|
||||||
|
|
||||||
[features]
|
|
||||||
rocket_okapi = []
|
|
Loading…
x
Reference in New Issue
Block a user