File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
api/src/infrastructure/monitoring
webapp/app/api/monitoring/readiness Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 6767 - name : Smoke test API
6868 run : |
6969 sleep 15
70- curl -sf http://localhost:3001/monitoring/readiness || exit 1
70+ curl -f -s -o /dev/null -w "%{http_code}" http://localhost:3001/monitoring/readiness | grep -q "^200$" || {
71+ echo "API not healthy (didn't return 200)"
72+ exit 1
73+ }
7174
7275 - name : Smoke test Webapp
7376 run : |
7477 sleep 15
75- curl -sf http://localhost:3000/api/monitoring || exit 1
78+ curl -f -s -o /dev/null -w "%{http_code}" http://localhost:3000/api/monitoring/readiness | grep -q "^200$" || {
79+ echo "Webapp not healthy (didn't return 200)"
80+ exit 1
81+ }
Original file line number Diff line number Diff line change @@ -30,6 +30,6 @@ export class HealthController {
3030
3131 @Get ( '/ping' )
3232 async ping ( ) : Promise < { status : string } > {
33- return { status : 'ok ' } ;
33+ return { status : 'OK ' } ;
3434 }
3535}
Original file line number Diff line number Diff line change @@ -6,10 +6,16 @@ export async function GET() {
66 if ( ! apiBaseUrl ) {
77 throw new Error ( 'API_BASE_URL not configured' ) ;
88 }
9- const pingResponse = await fetch ( `${ apiBaseUrl } /ping` ) ;
9+ const pingResponse = await fetch ( `${ apiBaseUrl } /monitoring/ ping` ) ;
1010 const data = await pingResponse . json ( ) ;
11- if ( data . status === 'ok' ) {
12- return NextResponse . json ( { ready : true } , { status : 200 } ) ;
11+ if ( data . status === 'OK' ) {
12+ return NextResponse . json ( { status : 'OK' } , { status : 200 } ) ;
13+ } else {
14+ console . log ( data ) ;
15+ return NextResponse . json (
16+ { error : data . message } ,
17+ { status : data . status }
18+ ) ;
1319 }
1420 } catch ( error : any ) {
1521 return NextResponse . json ( { error : error . message } , { status : 400 } ) ;
You can’t perform that action at this time.
0 commit comments