2016-09-12 09:43:34 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(rocket_codegen)]
|
|
|
|
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
use rocket::Rocket;
|
2016-09-21 03:02:33 +00:00
|
|
|
use rocket::response::{data, Stream};
|
2016-09-12 09:43:34 +00:00
|
|
|
|
|
|
|
use std::io::{repeat, Repeat, Read, Take};
|
|
|
|
|
|
|
|
type LimitedRepeat = Take<Repeat>;
|
|
|
|
|
|
|
|
#[get("/")]
|
2016-09-21 03:02:33 +00:00
|
|
|
fn root() -> data::Plain<Stream<LimitedRepeat>> {
|
|
|
|
data::Plain(Stream::from(repeat('a' as u8).take(25000)))
|
2016-09-12 09:43:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
Rocket::new("localhost", 8000).mount_and_launch("/", routes![root]);
|
|
|
|
}
|