mirror of
https://github.com/okiba-org/backend.git
synced 2025-07-14 18:55:52 +00:00
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
1331
Cargo.lock
generated
Normal file
1331
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 = "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
src/main.rs
Normal file
18
src/main.rs
Normal file
@ -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
|
||||
}
|
3
test/endpoitns.txt
Normal file
3
test/endpoitns.txt
Normal file
@ -0,0 +1,3 @@
|
||||
/paste
|
||||
/get/<id>
|
||||
/status
|
0
test/test.rest
Normal file
0
test/test.rest
Normal file
Reference in New Issue
Block a user