diff options
| author | Fuwn <[email protected]> | 2022-03-27 00:05:52 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-27 00:05:52 +0000 |
| commit | 7ae322a1bb4ed93f20e98dcb3416057808dbd434 (patch) | |
| tree | c74def5a31df5e261236b7300d90390fb57a1258 /examples | |
| parent | refactor(mount): context is now struct (diff) | |
| download | windmark-7ae322a1bb4ed93f20e98dcb3416057808dbd434.tar.xz windmark-7ae322a1bb4ed93f20e98dcb3416057808dbd434.zip | |
feat(router): modules
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/windmark.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs index 5568249..e1cb513 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -21,7 +21,7 @@ #[macro_use] extern crate log; -use windmark::response::Response; +use windmark::Response; fn main() -> std::io::Result<()> { windmark::Router::new() @@ -29,6 +29,9 @@ fn main() -> std::io::Result<()> { .set_certificate_chain_file("windmark_pair.pem") .enable_default_logger(true) .set_error_handler(|_| Response::PermanentFailure("error...".to_string())) + .attach(|r| { + r.mount("/module", |_| Response::Success("This is a module!".into())); + }) .set_pre_route_callback(|stream, url, _| { info!( "accepted connection from {} to {}", |