Fully working CRUD REST API using
- Rust (stable)
- Rocket.rs
- mongodb
- okapi
- Establish MongoDB connection using rocket Adhoc fairing.
- Custom error handlings with rocket Responder and okapi OpenApiGenerator.
- CORS fairing and Counter fairing to demonstrate how fairing works.
- Request guard using ApiKey.
- Implement Open API documentation using okapi.
- Test codes to test API endpoints.
setup.sh
to the ploy the projet on production
deploy-rust.sh
on the remote server to install the dependencies (rust compiler ..) to zip the code sources , copy it to the server , compile and run
make dev
cargo run
cargo build --release && cargo run --release
cargo test
ℹ️ You should create your own .env
file including MONGO_URI
, MONGO_DB_NAME
, and API_KEY
to run it.