mirror of
https://github.com/rwf2/Rocket.git
synced 2024-12-30 22:32:38 +00:00
48c333721c
Also re-exports the 'async_trait' attribute from 'rocket'.
21 lines
402 B
Rust
21 lines
402 B
Rust
#![feature(proc_macro_hygiene)]
|
|
#![allow(dead_code)]
|
|
|
|
#[macro_use] extern crate rocket;
|
|
use rocket::http::uri::Origin;
|
|
use rocket::request::Request;
|
|
|
|
async fn noop() { }
|
|
|
|
#[get("/")]
|
|
async fn hello(_origin: &Origin<'_>) -> &'static str {
|
|
noop().await;
|
|
"Hello, world!"
|
|
}
|
|
|
|
#[catch(404)]
|
|
async fn not_found(req: &Request<'_>) -> String {
|
|
noop().await;
|
|
format!("{} not found", req.uri())
|
|
}
|