Skip to content

sr2ds/blog-api-with-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog API - Writing in Rust with Actix Web

This Repository is only one practice project with Rust Language. I'm use Actix Web Framework and MongoDB.

MongoDB ODM: https://crates.io/crates/wither

Actix Web: https://actix.rs/

The CRUD operator is full work for articles, the routes have resource pattern with Restfull methods GET POST PUT DELETE.

Store one article

 curl -X POST --header "Content-Type: application/json" --data \
    '{"author":"David","title":"Rust Blog Article","created_at":"2021-04-15","content":"blank"}' \
    http://localhost:8080/articles

Setup Dev

MongoDB - Docker Container

docker run -d -p 27017:27017 -v pwd/data/db:/data/db --name blogApiRust mongo

Run

cargo watch -x run

Languages