generated from pure_sagacity/rust-starter
added a bun profile for devenv
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use axum::{Router, routing::get};
|
||||
use tokio::net::TcpListener;
|
||||
|
||||
fn data_dir() -> PathBuf {
|
||||
std::env::var("HARBOR_DATA_DIR")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|_| PathBuf::from("/var/lib/harbor"))
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let app = Router::new().route("/health", get(health_check));
|
||||
|
||||
+33
@@ -1,4 +1,5 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
@@ -26,12 +27,44 @@
|
||||
];
|
||||
};
|
||||
|
||||
processes.server =
|
||||
let
|
||||
port = config.processes.server.ports.server.value;
|
||||
in
|
||||
{
|
||||
ports.server.allocate = 8080;
|
||||
exec = "PORT=${toString port} HOST=127.0.0.1 cargo watch -s' cargo run -p server'";
|
||||
ready = {
|
||||
http.get = {
|
||||
port = port;
|
||||
path = "/health";
|
||||
host = "127.0.0.1";
|
||||
scheme = "http";
|
||||
};
|
||||
initial_delay = 5;
|
||||
period = 5;
|
||||
probe_timeout = 3;
|
||||
success_threshold = 1;
|
||||
failure_threshold = 3;
|
||||
};
|
||||
};
|
||||
|
||||
dotenv.enable = true;
|
||||
|
||||
enterTest = ''
|
||||
cargo test
|
||||
'';
|
||||
|
||||
profiles.website.module = {
|
||||
languages.javascript = {
|
||||
enable = true;
|
||||
bun = {
|
||||
enable = true;
|
||||
install.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
git-hooks.hooks = {
|
||||
shellcheck.enable = true;
|
||||
prettier.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user