Initial commit: визитка mikhailkilin.ru
Rust/Axum HTTP-сервер, Dockerfile, Woodpecker CI pipeline, Kubernetes-манифесты для деплоя на k3s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
src/main.rs
Normal file
19
src/main.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use axum::{response::Html, routing::get, Router};
|
||||
use std::net::SocketAddr;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// Создаем роутер, который на "/" отдает HTML
|
||||
let app = Router::new().route("/", get(handler));
|
||||
|
||||
// Слушаем порт 3000
|
||||
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
|
||||
println!("listening on {}", addr);
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
|
||||
axum::serve(listener, app).await.unwrap();
|
||||
}
|
||||
|
||||
async fn handler() -> Html<&'static str> {
|
||||
Html("<h1>Hello on mikhailkilin.ru! 🚀</h1>")
|
||||
}
|
||||
Reference in New Issue
Block a user