-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test passes while it's running in the background
- Loading branch information
1 parent
7bc463b
commit b77bfd9
Showing
5 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ authors = ["Jason Ribble <[email protected]>"] | |
[dependencies] | ||
anyhow = "1.0.86" | ||
async-trait = "0.1.80" | ||
axum = "0.7.7" | ||
chrono = "0.4.38" | ||
clap = { version = "4.5.9", features = ["derive"] } | ||
dotenvy = "0.15.0" | ||
|
@@ -29,6 +30,10 @@ reqwest = { version = "0.12", features = ["json"] } | |
name = "nbd-cli" | ||
path = "src/cli/main.rs" | ||
|
||
[[bin]] | ||
name = "nbd-api" | ||
path = "src/api/main.rs" | ||
|
||
[lib] | ||
name = "nbd" | ||
path = "src/lib.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![allow(dead_code)] | ||
use axum::{routing::get, Router}; | ||
|
||
#[tokio::main] | ||
|
||
async fn main() { | ||
// build our application with a single route | ||
let app = Router::new().route("/ok", get(ok)); | ||
|
||
// run our app with hyper, listening globally on port 8080 | ||
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap(); | ||
axum::serve(listener, app).await.unwrap(); | ||
} | ||
|
||
async fn ok() -> String { | ||
"ok".to_string() | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[tokio::test] | ||
async fn test_ok_endpoint() { | ||
let response = ok().await; | ||
assert_eq!(response, "ok"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod api; | ||
pub mod db; | ||
pub mod models; | ||
pub mod utils; |