You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: bind to 0.0.0.0 and prefer PORT over APP_PORT for platform deploys
The Express and H3 drivers now read APP_HOST (falling back to HOST),
defaulting to 0.0.0.0 so the server listens on all network interfaces.
This lets platform healthcheck proxies such as Railway reach the app
instead of failing against a localhost-only bind.
Server port resolution also now prefers the platform-provided PORT env
variable over APP_PORT (PORT -> APP_PORT -> 3000), so deployments bind to
the expected port without extra configuration.
Adds APP_HOST to the Express/H3 .env templates and documents host/port
binding (with Railway guidance) in the runtime guides.
Copy file name to clipboardExpand all lines: docs/guide/express-runtime.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,22 @@ this.driver = new ExpressDriver({
121
121
});
122
122
```
123
123
124
+
## Host & Port Binding
125
+
126
+
The server resolves its listening port and host from environment variables, which makes it portable across hosting platforms (Railway, Heroku, Render, etc.).
|`PORT`| — | Platform-provided port. Preferred over `APP_PORT` when present. |
131
+
|`APP_PORT`|`3000`| Application port used when `PORT` is not set. |
132
+
|`APP_HOST` (or `HOST`) |`0.0.0.0`| Host the server binds to. |
133
+
134
+
Port resolution order is `PORT` → `APP_PORT` → `3000`. Platforms such as Railway inject a `PORT` variable at runtime, so it takes precedence automatically.
135
+
136
+
The server binds to `0.0.0.0` by default so it is reachable on all network interfaces. This is required for platform healthcheck proxies (e.g. Railway) to reach the app. To restrict the server to local connections only, set `APP_HOST=localhost`.
137
+
138
+
> **Deploying to Railway:** point `APP_PORT` at Railway's `PORT` variable (`APP_PORT=${{ PORT }}`) or simply rely on the built-in `PORT` precedence, and leave `APP_HOST` at its `0.0.0.0` default.
139
+
124
140
## Notes
125
141
126
142
-`app.boot(port)` mounts public assets, binds router, applies middleware, registers error handling, starts the server, and attaches graceful shutdown.
Copy file name to clipboardExpand all lines: docs/guide/h3-runtime.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,22 @@ this.driver = new H3Driver({
118
118
});
119
119
```
120
120
121
+
## Host & Port Binding
122
+
123
+
The server resolves its listening port and host from environment variables, which makes it portable across hosting platforms (Railway, Heroku, Render, etc.).
|`PORT`| — | Platform-provided port. Preferred over `APP_PORT` when present. |
128
+
|`APP_PORT`|`3000`| Application port used when `PORT` is not set. |
129
+
|`APP_HOST` (or `HOST`) |`0.0.0.0`| Host the server binds to. |
130
+
131
+
Port resolution order is `PORT` → `APP_PORT` → `3000`. Platforms such as Railway inject a `PORT` variable at runtime, so it takes precedence automatically.
132
+
133
+
The server binds to `0.0.0.0` by default so it is reachable on all network interfaces. This is required for platform healthcheck proxies (e.g. Railway) to reach the app. To restrict the server to local connections only, set `APP_HOST=localhost`.
134
+
135
+
> **Deploying to Railway:** point `APP_PORT` at Railway's `PORT` variable (`APP_PORT=${{ PORT }}`) or simply rely on the built-in `PORT` precedence, and leave `APP_HOST` at its `0.0.0.0` default.
136
+
121
137
## Notes
122
138
123
139
-`app.boot(port)` mounts public assets, binds router, applies middleware, starts the server, and attaches graceful shutdown.
Copy file name to clipboardExpand all lines: docs/more/changelog.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,20 @@ The format follows semantic versioning principles.
8
8
9
9
### Added
10
10
11
+
- Added `APP_HOST` (with `HOST` fallback) to override the server bind host in the Express and H3 drivers, defaulting to `0.0.0.0` so the app is reachable on all network interfaces.
12
+
11
13
### Changed
12
14
15
+
- Prefer the platform-provided `PORT` env variable over `APP_PORT` when resolving the server port, so deployments on Railway, Heroku, and similar platforms bind to the expected port automatically.
16
+
13
17
### Docs
14
18
19
+
- Documented host and port binding for the Express and H3 runtimes, including Railway deployment guidance.
20
+
15
21
### Fixed
16
22
23
+
- Fixed deployments where the server bound to `localhost` and platform healthcheck proxies (e.g. Railway) could not reach the app.
0 commit comments