Initial Commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/target
|
||||||
1604
Cargo.lock
generated
Normal file
1604
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
Normal file
11
Cargo.toml
Normal 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
2
README.md
Normal 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
17
src/main.rs
Normal 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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user