首次提交

This commit is contained in:
2026-01-29 00:28:20 +08:00
commit f1d846bb8b
4 changed files with 1705 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target
.idea

1675
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

10
Cargo.toml Normal file
View File

@@ -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
src/main.rs Normal file
View File

@@ -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>")
}