generated from Patagia/template-nix
Compare commits
3 commits
6de14bb200
...
eff094e856
Author | SHA1 | Date | |
---|---|---|---|
eff094e856 | |||
fbbd753312 | |||
35ab2b31c5 |
2 changed files with 9 additions and 9 deletions
|
@ -36,6 +36,7 @@ struct Cli {}
|
|||
#[derive(Serialize, JsonSchema)]
|
||||
struct VersionInfo {
|
||||
name: String,
|
||||
version: String,
|
||||
}
|
||||
|
||||
/// Fetch version info.
|
||||
|
@ -57,7 +58,8 @@ async fn api_version(
|
|||
rqctx: RequestContext<Arc<()>>,
|
||||
) -> Result<HttpResponseOk<VersionInfo>, HttpError> {
|
||||
let ver = VersionInfo {
|
||||
name: String::from("patagia-controller"),
|
||||
name: env!("CARGO_PKG_NAME").to_string(),
|
||||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
};
|
||||
|
||||
tracing::info!("Someone made a request to /version");
|
||||
|
|
14
justfile
14
justfile
|
@ -1,18 +1,16 @@
|
|||
set shell := ["/usr/bin/env", "bash", "-euo", "pipefail", "-c"]
|
||||
|
||||
export OTEL_SERVICE_NAME := "my-program"
|
||||
|
||||
[private]
|
||||
default:
|
||||
@just --choose
|
||||
|
||||
# Run
|
||||
run $RUST_LOG="debug":
|
||||
nix run
|
||||
# Run controller
|
||||
run-controller $RUST_LOG="debug":
|
||||
cargo run --package patagia-controller
|
||||
|
||||
# Run local development
|
||||
dev:
|
||||
watchexec --clear --restart --stop-signal INT --debounce 300ms -- just run
|
||||
# Run controller local development
|
||||
dev-controller:
|
||||
watchexec --clear --restart --stop-signal INT --debounce 300ms -- just run-controller
|
||||
|
||||
# Run all tests
|
||||
check:
|
||||
|
|
Loading…
Reference in a new issue