Changelog - 2026-11-10
ServerInfoComponent serves the server time at GET /server/info/time
New FeatureIn one line. ServerInfoComponent mounts GET /server/info/time, a public route a client can call to read the server clock and work out its own clock skew. It is separate from HealthCheckComponent, so locking /health/* away does not break it.
What changed
- New component.
this.component(ServerInfoComponent)mountsGET /server/info/time. No authentication. The response sendsCache-Control: no-store. - One consistent body.
server(date,time,epoch,isoin the server time zone),tz, andutc(offset,minutes,iso) all come from one instant. - Compute skew from
server.epoch.skew ≈ server.epoch − (t0 + t1) / 2, witht0the send time andt1the receive time. TheDateheader is not a substitute: one-second precision, and a proxy can rewrite it. utc.minutesis positive east of UTC.420for+07:00. This is the opposite sign ofDate.prototype.getTimezoneOffset().- Configurable path.
restOptions.pathinIServerInfoOptions, default/server/info. - Public by design. The component carries only data that is safe to publish: no version, runtime, pid, memory or environment. Those stay in the gated
/health/stats.
Who is affected
- Apps that do not register the component. No action needed. Nothing changes.
- Apps that want a client clock check. Register
ServerInfoComponentand make sure the gateway exposes the path. See Server Info.
Details
typescript
this.component(ServerInfoComponent);
// or, on another path:
this.component(ServerInfoComponent, { options: { restOptions: { path: '/clock' } } });