hello world
This commit is contained in:
commit
2b527a325c
4 changed files with 2599 additions and 0 deletions
18
src/main.rs
Normal file
18
src/main.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use actix_web::{get, App, HttpServer};
|
||||
use log::info;
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> Result<(), std::io::Error> {
|
||||
env_logger::init();
|
||||
|
||||
info!("Server starting...");
|
||||
HttpServer::new(|| App::new().service(hello))
|
||||
.bind(("127.0.0.1", 6767))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
||||
#[get("/hello")]
|
||||
async fn hello() -> &'static str {
|
||||
"hello"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue