diff --git a/routes/api.ts b/routes/api.ts index db2fa04615..fead2d9328 100644 --- a/routes/api.ts +++ b/routes/api.ts @@ -8,8 +8,8 @@ route.get('/api/welcome/', () => 'hello world 4') // stacksjs.org/api/welcome/ route.health() // /api/health // route.action('BuddyAction') // /api/buddy -route.get('/api/buddy/commands', 'Buddy/CommandsAction') // /api/buddy -route.get('/api/buddy/versions', 'Buddy/VersionsAction') // /api/buddy +route.get('/api/buddy/commands', 'Buddy/CommandsAction') +route.get('/api/buddy/versions', 'Buddy/VersionsAction') // route.job('/api/example') // the equivalent of route.get('/api/example', 'ExampleJob') // route.get('/api/buddy-2', '../app/Actions/BuddyAction') // todo: support this // route.get('/api/buddy-3', import('../app/Actions/BuddyAction')) // todo: support this diff --git a/storage/framework/core/cloud/src/cloud/compute.ts b/storage/framework/core/cloud/src/cloud/compute.ts index 2fead67f4b..33d51e1f9f 100644 --- a/storage/framework/core/cloud/src/cloud/compute.ts +++ b/storage/framework/core/cloud/src/cloud/compute.ts @@ -53,7 +53,7 @@ export class ComputeStack { }), }), healthCheck: { - command: ['CMD-SHELL', 'curl -f http://localhost:3000/api/healthy || exit 1'], // requires curl inside the container which isn't available in the base image. I wonder if there is a better way + command: ['CMD-SHELL', 'curl -f http://localhost:3000/api/health || exit 1'], // requires curl inside the container which isn't available in the base image. I wonder if there is a better way interval: Duration.seconds(10), timeout: Duration.seconds(5), retries: 3, @@ -114,7 +114,7 @@ export class ComputeStack { port: 3000, healthCheck: { interval: Duration.seconds(6), - path: '/api/healthy', + path: '/api/health', protocol: elbv2.Protocol.HTTP, timeout: Duration.seconds(5), healthyThresholdCount: 2, diff --git a/storage/framework/core/router/src/router.ts b/storage/framework/core/router/src/router.ts index 7069a2f18d..515092f313 100644 --- a/storage/framework/core/router/src/router.ts +++ b/storage/framework/core/router/src/router.ts @@ -66,7 +66,7 @@ export class Router implements RouterInterface { const healthModule = await import(p.userActionsPath('HealthAction.ts')) const callback = healthModule.default.handle - this.addRoute('GET', '/api/healthy', callback, 200) + this.addRoute('GET', '/api/health', callback, 200) return this }