Initial Commit

This commit is contained in:
2026-07-11 18:54:33 +02:00
commit c6fbebf3ff
5 changed files with 1635 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

1604
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

11
Cargo.toml Normal file
View File

@@ -0,0 +1,11 @@
[package]
name = "api"
version = "0.1.0"
edition = "2024"
[dependencies]
sqlx = {version = "0.9.0", features = ["runtime-tokio", "postgres", "macros"]}
axum = {version = "0.8.9", feature = ["full"]}
tokio = {version = "1.52.3", features = ["full"]}
tower = "0.5.3"
dotenvy = "0.15.7"

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# Porning CS2 API server
The API server used for the web app and the plugin allowing data communication between both.

17
src/main.rs Normal file
View File

@@ -0,0 +1,17 @@
use std::error::Error;
use axum::routing::get;
use axum::{serve, Router};
use tokio::net::TcpListener;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let app = Router::new()
.route("/", get(hello));
let listener = TcpListener::bind("0.0.0.0:80").await?;
Ok(serve(listener, app).await?)
}
async fn hello() -> &'static str {
"Hello World"
}