Rocket - Core API Documentation
Hello, and welcome to the core Rocket API documentation!
This API documentation is highly technical and is purely a reference. There's an overview of Rocket on the main site as well as a full, detailed guide. If you'd like pointers on getting started, see the quickstart or getting started chapters of the guide.
You may also be interested in looking at the
rocket_contrib
documentation, which contains
automatic JSON (de)serialiazation, templating support, static file serving,
and other useful features.
Libraries
Rocket's functionality is split into two crates:
- Core - This core library. Needed by every Rocket application.
- Contrib - Provides useful functionality for many Rocket applications. Completely optional.
Usage
First, depend on rocket
in Cargo.toml
:
[]
= "0.4.1"
Then, add the following to the top of your main.rs
file:
extern crate rocket;
#
#
See the guide for more information on how to write Rocket applications. Here's a simple example to get you started:
extern crate rocket;
Configuration
Rocket and Rocket libraries are configured via the Rocket.toml
file and/or
ROCKET_{PARAM}
environment variables. For more information on how to
configure Rocket, see the configuration section of the guide as well as
the [config
] module documentation.
Testing
The [local
] module contains structures that facilitate unit and
integration testing of a Rocket application. The top-level [local
] module
documentation and the testing chapter of the guide include detailed
examples.