File tree 6 files changed +8
-6
lines changed
tests/servers/api/v1/contract/context
6 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ async fn main() {
11
11
let args: Vec < String > = env:: args ( ) . collect ( ) ;
12
12
if args. len ( ) != 2 {
13
13
eprintln ! ( "Usage: cargo run --bin http_health_check <HEALTH_URL>" ) ;
14
- eprintln ! ( "Example: cargo run --bin http_health_check http://127.0.0.1:1212/health_check" ) ;
14
+ eprintln ! ( "Example: cargo run --bin http_health_check http://127.0.0.1:1212/api/ health_check" ) ;
15
15
std:: process:: exit ( 1 ) ;
16
16
}
17
17
Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ pub fn router(tracker: Arc<Tracker>) -> Router {
29
29
tracker. config . clone ( ) ,
30
30
v1:: middlewares:: auth:: auth,
31
31
) )
32
- . route ( " /health_check", get ( health_check_handler) )
32
+ . route ( & format ! ( "{api_url_prefix} /health_check") , get ( health_check_handler) )
33
33
. layer ( CompressionLayer :: new ( ) )
34
34
}
Original file line number Diff line number Diff line change 8
8
//!
9
9
//! # Health Check
10
10
//!
11
- //! `GET /health_check`
11
+ //! `GET /api/ health_check`
12
12
//!
13
13
//! Returns the API status.
14
14
//!
15
15
//! **Example request**
16
16
//!
17
17
//! ```bash
18
- //! curl "http://127.0.0.1:1212/health_check"
18
+ //! curl "http://127.0.0.1:1212/api/ health_check"
19
19
//! ```
20
20
//!
21
21
//! **Example response** `200`
Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ use crate::core::Tracker;
9
9
/// Add the routes for the v1 API.
10
10
pub fn add ( prefix : & str , router : Router , tracker : Arc < Tracker > ) -> Router {
11
11
let v1_prefix = format ! ( "{prefix}/v1" ) ;
12
+
12
13
let router = auth_key:: routes:: add ( & v1_prefix, router, tracker. clone ( ) ) ;
13
14
let router = stats:: routes:: add ( & v1_prefix, router, tracker. clone ( ) ) ;
14
15
let router = whitelist:: routes:: add ( & v1_prefix, router, tracker. clone ( ) ) ;
16
+
15
17
torrent:: routes:: add ( & v1_prefix, router, tracker)
16
18
}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ async fn api_health_check(config: &HttpApi) -> Option<Json<Report>> {
45
45
let addr: SocketAddr = config. bind_address . parse ( ) . expect ( "invalid socket address for API" ) ;
46
46
47
47
if addr. port ( ) != UNKNOWN_PORT {
48
- let health_check_url = format ! ( "http://{addr}/health_check" ) ;
48
+ let health_check_url = format ! ( "http://{addr}/api/ health_check" ) ;
49
49
50
50
if !get_req_is_ok ( & health_check_url) . await {
51
51
return Some ( responses:: error ( format ! (
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use crate::servers::api::v1::client::get;
8
8
async fn health_check_endpoint_should_return_status_ok_if_api_is_running ( ) {
9
9
let test_env = running_test_environment ( configuration:: ephemeral ( ) ) . await ;
10
10
11
- let url = format ! ( "http://{}/health_check" , test_env. get_connection_info( ) . bind_address) ;
11
+ let url = format ! ( "http://{}/api/ health_check" , test_env. get_connection_info( ) . bind_address) ;
12
12
13
13
let response = get ( & url, None ) . await ;
14
14
You can’t perform that action at this time.
0 commit comments