runtime
Webda runtime service bundle — router, cluster coordination, proxy, invitation system, version endpoint, and core utility models bundled for use in any Webda deployment.
When to use it
- You need a cluster-coordination service (
ClusterService) to synchronize multiple Webda instances via pub/sub. - You want a built-in
VersionServiceendpoint (GET /version) that returns the current application version. - You need an HTTP reverse proxy (
ProxyService) to forward matching requests to an upstream service. - You need an invitation/join-code workflow (
InvitationService) for user onboarding.
Install
pnpm add @webda/runtime
What's inside
Services
ClusterService— Coordinates multiple Webda instances via a pub/sub channel; broadcasts invalidation events (source)EchoService— Development helper that echoes request bodies back to the caller (source)InvitationService— Token-based invitation/join-code system for model membership (source)ProxyService— HTTP reverse proxy that forwards requests matching a URL prefix to an upstream host (source)VersionService— Exposes a/versionendpoint returning the application name and version (source)
Utility models
BinaryModel— Base model with binary attachment support (source)PasswordModel— Secure password hashing helper (source)
Quick config example
{
"services": {
"versionService": {
"type": "VersionService",
"url": "/version"
},
"proxy": {
"type": "ProxyService",
"url": "/legacy",
"upstream": "http://old-service:8080"
}
}
}
Reference
- API reference: see the auto-generated typedoc at
docs/pages/Modules/runtime/. - Source:
packages/runtime - Related:
@webda/corefor the baseServiceandStoreclasses;@webda/amqpor@webda/gcpas the pub/sub backend forClusterService.
Classes
- BinaryModel
- ClusterService
- ClusterServiceParameters
- EchoService
- EchoServiceParameters
- EventIterator
- MergedIterator
- PasswordEncryptionService
- ProxyParameters
- ProxyService
- VersionService
- VersionServiceParameters