init commit
This commit is contained in:
12
src/main.rs
Normal file
12
src/main.rs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user