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:

Eleventy Adoption Guide: Overview, Examples, And Alternatives

Eleventy adoption guide: Overview, examples, and alternatives

Eleventy (11ty) is a compelling solution for developers seeking a straightforward, performance-oriented approach to static site generation.

Nelson Michael
May 7, 2024 â‹… 8 min read
6 CSS Tools For More Efficient And Flexible CSS Handling

6 CSS tools for more efficient and flexible CSS handling

Explore some CSS tools that offer the perfect blend of efficiency and flexibility when handling CSS, such as styled-components and Emotion.

Fimber Elemuwa
May 7, 2024 â‹… 7 min read
Leveraging React Server Components In Redwoodjs

Leveraging React Server Components in RedwoodJS

RedwoodJS announced support for server-side rendering and RSCs in its Bighorn release. Explore this feature for when it’s production-ready.

Stephan Miller
May 6, 2024 â‹… 9 min read
Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 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