A demo blog post engine written in Rust, using Rocket and MongoDB
-
Setup a new MongoDB cluster https://cloud.mongodb.com/ create a new database and obtain the rust connection string (under Database/Connect) example (
mongodb+srv://<user>:<password>@XXXX.mongodb.net/myFirstDatabase?retryWrites=true&w=majority) -
Create a database
rust_blog_engine -
Add a collection
authorizationcontaining authorized users id (Google user id)
{
"_id": "116710526826489061000",
"email": "[email protected]",
"name": "Nabil Hachicha"
}-
Add a collection
blogswhich will persist our blog posts entries.
-
Setup a Google OAuth2 API and add the
client_idandclient_secretinside the Rocket.toml file. -
Start the engine using
cargo runand providing the MongoDB connection string
MDB_URL="mongodb+srv://<user>:<password>@XXXX.mongodb.net/myFirstDatabase?retryWrites=true&w=majority" cargo run 



