2023-02-08
2588
#rust
Bastian Gruber
17568
Feb 8, 2023 â‹… 9 min read

Building a REST API in Rust with warp

Bastian Gruber I'm a passionate software developer who mainly works with Rust to create services for the web. Next to that, I write for several tech magazines and publish articles on my own. Every now and then I get interviewed as well.

Recent posts:

Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
Exploring Zed, A Newly Open Source Code Editor Written In Rust

Exploring Zed, an open source code editor written in Rust

The Zed code editor sets itself apart with its lightning-fast performance and cutting-edge collaborative features.

Nefe Emadamerho-Atori
Apr 22, 2024 â‹… 7 min read
Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
View all posts

5 Replies to "Building a REST API in Rust with warp"

  1. Thanks, I was stuck but your tutorial helped me. I’m noob to rust so I would love more tutorials 🙂

  2. Thanks for the tut. One remark though:
    “Due to the nature of Rust’s ownership model, you can’t simply read and return the underlying list of groceries.”
    That’s not true, the Deref trait on Mutex allows us to do this:

    Ok(warp::reply::json(&*store.grocery_list.read()));

    Cheers 🙂

  3. Thanks for the tutorial.

    Maybe I am missing something, but it seems to me, your curl delete example is missing the id. In fact I am missing where the id path section is defined at all for get (on a single item) and put.

  4. sorry noob here, how can I solve this ?:

    error: cannot find derive macro `Deserialize` in this scope
    –> src/serve.rs:69:17
    |
    69 | #[derive(Debug, Deserialize, Serialize, Clone)]
    | ^^^^^^^^^^^

    Thanks a lot !

Leave a Reply