Struct rusty_express::HttpServer
source · pub struct HttpServer { /* private fields */ }
Implementations§
source§impl HttpServer
impl HttpServer
pub fn new() -> Self
pub fn new_with_config(config: ServerConfig) -> Self
sourcepub fn listen(&mut self, port: u16)
pub fn listen(&mut self, port: u16)
listen
will take 1 parameter for the port that the server will be monitoring at, aka
127.0.0.1:port
. This function will block until the server is shut down.
Examples
extern crate rusty_express as express;
use express::prelude::*;
let mut server = HttpServer::new();
server.def_router(router);
server.listen(8080);