Struct susanoo::Susanoo
[−]
[src]
pub struct Susanoo { /* fields omitted */ }
Root instance of Web application.
Methods
impl Susanoo
[src]
fn with_route(self, route: Route) -> Self
Add a route to the application.
fn with_middleware<M: Middleware>(self, middleware: M) -> Self
Add a middleware to the application.
If you want to apply middelewares to certain route, use Route::with_middleware
.
fn bind<S: AsRef<str>>(self, addr: S) -> SusanooResult<Self>
Set listen address of the application.
The default address is "0.0.0.0:4000"
.
fn run(self) -> SusanooResult<()>
Run the server infinitely.