chore: default to port 8000
All checks were successful
Rust / check (push) Successful in 35s
Rust / test (push) Successful in 29s
Docker / build (push) Successful in 1m19s

This commit is contained in:
2026-06-16 14:39:53 +02:00
parent bfc7bd4f7c
commit 8268bd9692
6 changed files with 18 additions and 18 deletions

View File

@@ -4,7 +4,7 @@
use std::{env, process::ExitCode, time::Duration};
const DEFAULT_BASE_URL: &str = "http://localhost:5000";
const DEFAULT_BASE_URL: &str = "http://localhost:8000";
const REQUEST_TIMEOUT: Duration = Duration::from_secs(10);
#[tokio::main]
@@ -166,7 +166,7 @@ fn trim_base_url(base_url: &str) -> String {
}
const fn usage() -> &'static str {
"Usage:\n pokedex-cli [--base-url URL] health\n pokedex-cli [--base-url URL] metrics\n pokedex-cli [--base-url URL] pokemon <name>\n pokedex-cli [--base-url URL] translated <name>\n\nExamples:\n pokedex-cli pokemon mewtwo\n pokedex-cli translated mewtwo\n pokedex-cli --base-url http://localhost:5000 pokemon pikachu"
"Usage:\n pokedex-cli [--base-url URL] health\n pokedex-cli [--base-url URL] metrics\n pokedex-cli [--base-url URL] pokemon <name>\n pokedex-cli [--base-url URL] translated <name>\n\nExamples:\n pokedex-cli pokemon mewtwo\n pokedex-cli translated mewtwo\n pokedex-cli --base-url http://localhost:8000 pokemon pikachu"
}
#[derive(Debug, thiserror::Error)]
@@ -204,23 +204,23 @@ mod tests {
}
}
);
assert_eq!(args.url(), "http://localhost:5000/pokemon/mewtwo");
assert_eq!(args.url(), "http://localhost:8000/pokemon/mewtwo");
}
#[test]
fn parses_custom_base_url_and_translated_command() {
let args = parse_args([
"--base-url",
"http://localhost:5000/",
"http://localhost:8000/",
"translated",
"mr-mime",
])
.expect("args should parse");
assert_eq!(args.base_url, "http://localhost:5000");
assert_eq!(args.base_url, "http://localhost:8000");
assert_eq!(
args.url(),
"http://localhost:5000/pokemon/translated/mr-mime"
"http://localhost:8000/pokemon/translated/mr-mime"
);
}