Building a bookmarks API using Actix-web

We'll create a REST API server that allows you to store bookmarks and links to any blog or website that you wish to read later. We'll name our server linksnap. Let's create a new project by running cargo new linksnap. In this implementation, we won't be using a database for persistence for any link that is sent to our API, and will simply use an in-memory HashMap to store our entries. This means that every time our server restarts, all of the stored bookmarks will get removed. 

Under the linksnap/ directory, we have the following contents in Cargo.toml:

# linksnap/Cargo.toml[dependencies]actix = "0.7"actix-web = "0.7"futures = "0.1"env_logger = "0.5"bytes = "0.4"serde = "1.0.80"serde_json = "1.0.33" ...

Get The Complete Rust Programming Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.