@sdxc/kit 2026.10.23 → 2026.10.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,8 +101,8 @@ export function createWebRouter() {
101
101
  );
102
102
 
103
103
  router.map(
104
- apiRoutes.api.health,
105
- lazy(() => import("~/app/http/controllers/api/health")),
104
+ apiRoutes.health,
105
+ lazy(() => import("~/app/http/controllers/health")),
106
106
  );
107
107
  router.map(
108
108
  apiRoutes.api.openapi,
@@ -21,6 +21,7 @@
21
21
  "@sdxc/data-table-d1": "0.0.1",
22
22
  "@sdxc/database-middleware": "0.0.1",
23
23
  "@sdxc/get-client-ip": "0.0.1",
24
+ "@sdxc/health": "0.0.1",
24
25
  "@sdxc/honeypot": "0.0.1",
25
26
  "@sdxc/http": "0.0.1",
26
27
  "@sdxc/i18n": "0.0.1",
@@ -48,7 +49,7 @@
48
49
  "@sdxc/ui": "0.0.1",
49
50
  "@sdxc/user-agent": "0.0.1",
50
51
  "@sdxc/well-known": "0.0.1",
51
- "remix": "3.0.0"
52
+ "remix": "3.1.0"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@cloudflare/vite-plugin": "2.0.0-beta.sha-ad79608dd",
@@ -4,14 +4,17 @@
4
4
  * request read the same schemas.
5
5
  */
6
6
 
7
- import * as s from "@sdxc/json-schema";
7
+ import HEALTH_REPORT from "@sdxc/health/schema";
8
8
  import { defineOperation } from "@sdxc/openapi";
9
9
  import { get, post, route } from "remix/routes";
10
10
 
11
- /** The JSON endpoints under `/api`, and the MCP endpoint an agent connects to. */
11
+ /**
12
+ * The health check at `/health`, the path monitors look for first, the JSON endpoints under
13
+ * `/api`, and the MCP endpoint an agent connects to.
14
+ */
12
15
  const ROUTES = route({
16
+ health: get("/health"),
13
17
  api: {
14
- health: get("/api/health"),
15
18
  openapi: get("/api/openapi.json"),
16
19
  notFound: "/api/*path",
17
20
  },
@@ -20,10 +23,17 @@ const ROUTES = route({
20
23
 
21
24
  export default ROUTES;
22
25
 
23
- /** GET /api/health, the check a monitor or load balancer polls. */
24
- export const HEALTH = defineOperation("health", ROUTES.api.health, {
25
- summary: "Check the service",
26
+ /** GET /health, the check a monitor or load balancer polls, answered as `application/health+json`. */
27
+ export const HEALTH = defineOperation("health", ROUTES.health, {
28
+ summary: "Check the service and every dependency it reads",
26
29
  responses: {
27
- 200: { description: "The service is up", body: s.object({ status: s.literal("ok") }) },
30
+ 200: {
31
+ description: "Every critical dependency answers: the report's status is `pass` or `warn`",
32
+ body: { "application/health+json": HEALTH_REPORT },
33
+ },
34
+ 503: {
35
+ description: "A critical dependency fails: the report's status is `fail`",
36
+ body: { "application/health+json": HEALTH_REPORT },
37
+ },
28
38
  },
29
39
  });
@@ -1,15 +0,0 @@
1
- /**
2
- * The health check: it answers as soon as the Worker runs, so a monitor tells a deploy that
3
- * serves from one that fails to start.
4
- */
5
-
6
- import { createAction } from "remix/router";
7
-
8
- import api from "~/app/http/middleware/api";
9
- import routes from "~/routes/api";
10
-
11
- export default createAction(routes.api.health, {
12
- middleware: api,
13
- /** GET /api/health, answered as the `health` operation documents it. */
14
- handler: () => Response.json({ status: "ok" }),
15
- });