» Rust: Build a REST API with Rocket » 1. Introduction » 1.1 Preparation

Preparation

Install Rust

See How to install Rust?.

Note: This project uses rustc 1.76.0.

Pick an editor

Pick your favorite editor or use Visual Studio Code.

Learn Rust basics

If you're not familiar with Rust, you may try this tutorial: "Quick Introduction to Rust."

What is REST api

See What is REST api?.

Rocket web framework

Rocket Logo

Rocket is a web framework for Rust that makes it simple to write fast, type-safe, secure web applications with incredible usability, productivity and performance.

Here's a basic usage example:

#[macro_use] extern crate rocket;

#[get("/")]
fn index() -> &'static str {
    "Hello, world!"
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![index])
}