@arkstack/driver-h3 0.12.34 → 0.12.36

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.
@@ -1,4 +1,4 @@
1
- import { n as MiddlewareConfig, t as Middleware$2 } from "./types-yX_T9j5I.js";
1
+ import { n as MiddlewareConfig, t as Middleware$2 } from "./types-DPGHB4nY.js";
2
2
  import { ArkstackKitDriver, ArkstackRouteListOptions, PromiseOrValue } from "@arkstack/contract";
3
3
  import { H3, H3Event, HTTPError, HTTPResponse } from "h3";
4
4
  import { Route } from "clear-router";
@@ -77,6 +77,11 @@ declare class H3Driver extends ArkstackKitDriver<H3, H3Middleware> {
77
77
  /**
78
78
  * Starts the H3 server on the specified port.
79
79
  *
80
+ * The bind host can be overridden with the `APP_HOST` (or `HOST`) env
81
+ * variable. It defaults to `0.0.0.0` so the server is reachable on all
82
+ * network interfaces, which platforms like Railway require for their
83
+ * healthcheck proxy to reach the app.
84
+ *
80
85
  * @param app
81
86
  * @param port
82
87
  */
@@ -77,6 +77,11 @@ declare class H3Driver extends ArkstackKitDriver<H3, H3Middleware> {
77
77
  /**
78
78
  * Starts the H3 server on the specified port.
79
79
  *
80
+ * The bind host can be overridden with the `APP_HOST` (or `HOST`) env
81
+ * variable. It defaults to `0.0.0.0` so the server is reachable on all
82
+ * network interfaces, which platforms like Railway require for their
83
+ * healthcheck proxy to reach the app.
84
+ *
80
85
  * @param app
81
86
  * @param port
82
87
  */
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference path="./app.d.ts" />
2
- import { a as Router, i as H3Middleware, n as H3DriverOptions, o as defaultErrorHandler, r as H3EventResponse, t as H3Driver } from "./index-BJ2iafCy.js";
2
+ import { a as Router, i as H3Middleware, n as H3DriverOptions, o as defaultErrorHandler, r as H3EventResponse, t as H3Driver } from "./index--GiaEPJz.js";
3
3
  export { H3Driver, H3DriverOptions, H3EventResponse, H3Middleware, Router, defaultErrorHandler };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as staticAssetHandler } from "./middlewares-CGBJHsH7.js";
2
2
  import { Arkstack, ArkstackKitDriver } from "@arkstack/contract";
3
3
  import { H3, HTTPResponse, serve, toResponse } from "h3";
4
- import { ErrorHandler, Logger, isClass, renderError } from "@arkstack/common";
4
+ import { ErrorHandler, Logger, env, isClass, renderError } from "@arkstack/common";
5
5
  import { Request } from "clear-router";
6
6
  import { definePlugin } from "clear-router/core";
7
7
  import { definePlugin as definePlugin$1 } from "kanun";
@@ -1377,16 +1377,23 @@ var H3Driver = class extends ArkstackKitDriver {
1377
1377
  }
1378
1378
  /**
1379
1379
  * Starts the H3 server on the specified port.
1380
- *
1381
- * @param app
1382
- * @param port
1380
+ *
1381
+ * The bind host can be overridden with the `APP_HOST` (or `HOST`) env
1382
+ * variable. It defaults to `0.0.0.0` so the server is reachable on all
1383
+ * network interfaces, which platforms like Railway require for their
1384
+ * healthcheck proxy to reach the app.
1385
+ *
1386
+ * @param app
1387
+ * @param port
1383
1388
  */
1384
1389
  start(app, port) {
1390
+ const host = env("APP_HOST", env("HOST", "0.0.0.0"));
1385
1391
  serve(app, {
1386
1392
  port,
1393
+ hostname: host,
1387
1394
  silent: true
1388
1395
  }).ready().then(() => {
1389
- Logger.log([["Server is running on", "white"], [`http://localhost:${port}`, "cyan"]], " ");
1396
+ Logger.log([["Server is running on", "white"], [`http://${host}:${port}`, "cyan"]], " ");
1390
1397
  });
1391
1398
  }
1392
1399
  };
@@ -1,4 +1,4 @@
1
- import { i as H3Middleware } from "../index-BJ2iafCy.js";
1
+ import { i as H3Middleware } from "../index--GiaEPJz.js";
2
2
  import * as _$h3 from "h3";
3
3
  import { EventHandlerRequest, H3Event } from "h3";
4
4
  import { NextFunction } from "clear-router/types/h3";
@@ -6,7 +6,7 @@ import { Router } from "clear-router/h3";
6
6
  import { ClassMiddleware } from "clear-router/types/basic";
7
7
  import { H3App, Handler, HttpContext, Middleware as Middleware$1 } from "clear-router/types/h3";
8
8
 
9
- //#region dist/index-DIJtwwZP.d.ts
9
+ //#region dist/index-E-098om7.d.ts
10
10
  //#endregion
11
11
  //#region src/index.d.ts
12
12
  type H3Middleware = Middleware$1 | [Middleware$1, Record<string, any>];
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as MiddlewareConfig, t as Middleware } from "./types-yX_T9j5I.js";
1
+ import { n as MiddlewareConfig, t as Middleware } from "./types-DPGHB4nY.js";
2
2
  export { Middleware, MiddlewareConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/driver-h3",
3
- "version": "0.12.34",
3
+ "version": "0.12.36",
4
4
  "type": "module",
5
5
  "description": "H3 driver for Arkstack, providing H3-based runtime integration for the framework.",
6
6
  "homepage": "https://arkstack.toneflix.net",
@@ -40,13 +40,13 @@
40
40
  "clear-router": "^2.8.8",
41
41
  "@resora/plugin-clear-router": "^1.0.62",
42
42
  "resora": "^1.3.25",
43
- "@arkstack/contract": "^0.12.34"
43
+ "@arkstack/contract": "^0.12.36"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "h3": "2.0.1-rc.22",
47
- "@arkstack/auth": "^0.12.34",
48
- "@arkstack/foundry": "^0.12.34",
49
- "@arkstack/common": "^0.12.34"
47
+ "@arkstack/auth": "^0.12.36",
48
+ "@arkstack/foundry": "^0.12.36",
49
+ "@arkstack/common": "^0.12.36"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@arkstack/auth": {