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:

Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
Using React Shepherd To Build A Site Tour

Using React Shepherd to build a site tour

React Shepherd stands out as a site tour library due to its elegant UI and out-of-the-box, easy-to-use React Context implementation.

Onuorah Bonaventure
May 1, 2024 â‹… 14 min read
A Guide To Cookies In Next Js

A guide to cookies in Next.js

Cookies are crucial to web development. This article will explore how to handle cookies in your Next.js applications.

Georgey V B
Apr 30, 2024 â‹… 10 min read
Handling Dates In JavaScript With Tempo

Handling dates in JavaScript with Tempo

Use the Tempo library to format dates and times in JavaScript while accounting for time zones, daylight saying time, and date internationalization.

Amazing Enyichi Agu
Apr 30, 2024 â‹… 8 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