Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.
/ tsukuyomi Public archive

Asynchronous Web framework for Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

tsukuyomi-rs/tsukuyomi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

header

Asynchronous Web framework for Rust.


Crates.io Minimal Rust Version: 1.31.0 Build Status Coverage Status Gitter

Features

  • Type-safe and composable handlers based on Extractor system
  • Scoped routing and middlewares
  • Asynchronous HTTP server based on tokio, hyper and tower-service

Usage

use {
    std::net::SocketAddr,
    tsukuyomi::{
        App,
        config::prelude::*,
    },
    tsukuyomi_server::Server,
};

fn main() -> tsukuyomi_server::Result<()> {
    let app = App::create(
        path!("/")
            .to(endpoint::reply("Hello, world.\n"))
    )?;

    let addr = SocketAddr::from(([127, 0, 0, 1], 4000));
    println!("Listening on http://{}", addr);

    Server::new(app).bind(addr).run()
}

Resources

Extensions

License

Tsukuyomi is licensed under either of MIT license or Apache License, Version 2.0 at your option.