mirror of
https://github.com/okiba-org/backend.git
synced 2026-08-04 22:25:29 +00:00
@@ -0,0 +1 @@
|
|||||||
|
/target
|
||||||
Generated
+1331
File diff suppressed because it is too large
Load Diff
+11
@@ -0,0 +1,11 @@
|
|||||||
|
[package]
|
||||||
|
name = "okiba-backend"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
actix-web = "4"
|
||||||
|
env_logger = "0.10.0"
|
||||||
|
log = "0.4.19"
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
use actix_web::{get, App, HttpServer};
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
async fn greet() -> &'static str {
|
||||||
|
"Hello, World"
|
||||||
|
}
|
||||||
|
|
||||||
|
#[actix_web::main]
|
||||||
|
async fn main() -> std::io::Result<()> {
|
||||||
|
const ADDR: (&str, u16) = ("127.0.0.1", 8080);
|
||||||
|
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||||
|
|
||||||
|
log::info!("Starting the server at http://{}:{}", ADDR.0, ADDR.1);
|
||||||
|
HttpServer::new(|| App::new().service(greet))
|
||||||
|
.bind(ADDR)?
|
||||||
|
.run()
|
||||||
|
.await
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/paste
|
||||||
|
/get/<id>
|
||||||
|
/status
|
||||||
Reference in New Issue
Block a user