init commit

This commit is contained in:
2020-01-12 23:53:10 +08:00
parent a1fa05a0df
commit 5d55a4e367
2 changed files with 22 additions and 0 deletions

12
src/main.rs Normal file
View File

@@ -0,0 +1,12 @@
use simple_server::Server;
fn main() {
let host = "127.0.0.1";
let port = "8080";
println!("Starting server @{}:{}...", host, port);
let server = Server::new(|_request, mut response| {
Ok(response.status(200).body("Hello, world!".as_bytes().to_vec())?)
});
server.listen(host, port);
}