首次提交
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
/target
|
||||||
|
.idea
|
||||||
Generated
+1675
File diff suppressed because it is too large
Load Diff
+10
@@ -0,0 +1,10 @@
|
|||||||
|
[package]
|
||||||
|
name = "LoggerServer"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
actix = "0.13.5"
|
||||||
|
actix-web = "4.12.1"
|
||||||
|
anyhow = "1.0.100"
|
||||||
|
tokio = { version = "1.49.0", features = ["full"] }
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
use actix_web::{App, HttpResponse, HttpServer, Responder, get, web};
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
HttpServer::new(|| App::new().service(root))
|
||||||
|
.bind(("0.0.0.0", 2018))
|
||||||
|
.unwrap()
|
||||||
|
.run()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
async fn root() -> impl Responder {
|
||||||
|
HttpResponse::Ok()
|
||||||
|
.content_type("text/html;charset=utf-8")
|
||||||
|
.body("<h1>侯浩彬是我儿子</h1>")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user