File tree Expand file tree Collapse file tree 1 file changed +6
-26
lines changed
Expand file tree Collapse file tree 1 file changed +6
-26
lines changed Original file line number Diff line number Diff line change 1- #[ macro_use]
2- extern crate rocket;
1+ use bibimbap_backend:: run;
32
4- #[ get( "/health_check" ) ]
5- fn health_check ( ) {
6- ( )
7- }
8-
9- #[ launch]
10- fn rocket ( ) -> _ {
11- rocket:: build ( ) . mount ( "/" , routes ! [ health_check] )
12- }
13-
14- #[ cfg( test) ]
15- mod test {
16- use super :: rocket;
17- use rocket:: http:: Status ;
18- use rocket:: local:: blocking:: Client ;
19- use std:: io:: Read ;
20-
21- #[ test]
22- fn health_check_works ( ) {
23- let client = Client :: tracked ( rocket ( ) ) . expect ( "Failed to create client" ) ;
24- let response = client. get ( uri ! ( super :: health_check) ) . dispatch ( ) ;
25-
26- assert_eq ! ( response. status( ) , Status :: Ok ) ;
27- assert_eq ! ( response. bytes( ) . count( ) , 0 ) ;
3+ #[ rocket:: main]
4+ async fn main ( ) {
5+ if let Err ( e) = run ( ) . launch ( ) . await {
6+ println ! ( "Failed to launch Rocket: {e}" ) ;
7+ drop ( e) ;
288 }
299}
You can’t perform that action at this time.
0 commit comments