mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-22 09:22:03 +00:00
19 lines
358 B
Rust
19 lines
358 B
Rust
#![feature(plugin, custom_derive)]
|
|
#![plugin(rocket_codegen)]
|
|
|
|
extern crate rocket;
|
|
|
|
use rocket::http::Cookies;
|
|
|
|
#[derive(FromForm)]
|
|
struct User {
|
|
name: String
|
|
}
|
|
|
|
#[post("/<name>", format = "application/json", form = "<user>", rank = 2)]
|
|
fn get(name: &str, user: User, cookies: &Cookies) -> &'static str { "hi" }
|
|
|
|
fn main() {
|
|
let _ = routes![get];
|
|
}
|