extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.put("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.post("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.delete("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/bar", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/a/*/d", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/a/**/d", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::static_files("examples/assets/"));
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/a/**/d", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::static_files("examples/assets/"));
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/a/**/d", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate serialize;
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
#[deriving(Decodable, Encodable)]
struct Person {
firstname: String,
lastname: String,
}
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::json_body_parser());
fn post_handler (request: &Request, response: &mut Response) {
let person = request.json_as::<Person>().unwrap();
let text = format!("Hello {} {}", person.firstname, person.lastname);
response.send(text.as_slice());
}
server.post("/a/post/request", post_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate serialize;
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
#[deriving(Decodable, Encodable)]
struct Person {
firstname: String,
lastname: String,
}
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::json_body_parser());
fn post_handler (request: &Request, response: &mut Response) {
let person = request.json_as::<Person>().unwrap();
let text = format!("Hello {} {}", person.firstname, person.lastname);
response.send(text.as_slice());
}
server.post("/a/post/request", post_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate serialize;
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
#[deriving(Decodable, Encodable)]
struct Person {
firstname: String,
lastname: String,
}
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::json_body_parser());
fn post_handler (request: &Request, response: &mut Response) {
let person = request.json_as::<Person>().unwrap();
let text = format!("Hello {} {}", person.firstname, person.lastname);
response.send(text.as_slice());
}
server.post("/a/post/request", post_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate serialize;
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response };
#[deriving(Decodable, Encodable)]
struct Person {
firstname: String,
lastname: String,
}
fn main() {
let mut server = Nickel::new();
server.utilize(Nickel::json_body_parser());
fn post_handler (request: &Request, response: &mut Response) {
let person = request.json_as::<Person>().unwrap();
let text = format!("Hello {} {}", person.firstname, person.lastname);
response.send(text.as_slice());
}
server.post("/a/post/request", post_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}
extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response, Action };
fn main() {
let mut server = Nickel::new();
fn logger (request: &Request, _response: &mut Response) -> Action {
println!("logging request: {}", request.origin.request_uri);
Continue
}
server.utilize(FromFn::new(logger));
fn a_handler (_request: &Request, response: &mut Response) {
response.send("hello world");
}
server.get("/a/**/d", a_handler);
server.listen(Ipv4Addr(127, 0, 0, 1), 6767);
}