Server API v1 #1
1313
server/Cargo.lock
generated
1313
server/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -5,3 +5,4 @@ edition = "2021"
|
||||
license = "GPL-3.0-only"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4.5.1"
|
||||
|
@ -1,3 +1,14 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use actix_web::{App, get, HttpResponse, HttpServer, Responder};
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| App::new().service(hello))
|
||||
.bind(("127.0.0.1", 8000))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
||||
#[get("/")]
|
||||
async fn hello() -> impl Responder {
|
||||
HttpResponse::Ok().body("Hello World!")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user