Skip to content

v0.4.3

Latest

Choose a tag to compare

@mayerdev mayerdev released this 28 Mar 02:46
· 2 commits to master since this release

What's new

NATS support

  • NatsController — request-reply handler with queue subscriptions (one instance per message)
  • NatsSubscription — pub-sub handler with broadcast subscriptions (all instances receive)
  • Subject format: [prefix.]controller-name.method-name
  • Context API: this.data, this.subject, this.controller, this.publish() (for subscriptions)
  • Expose active connection via require('dc-api-core').nats

Configuration

  • port: false — disable HTTP server (NATS-only services)
  • nats.url — NATS server URL
  • nats.prefix — optional subject prefix

Dev mode (--dev)

  • Registered HTTP endpoints, WebSocket and NATS subjects are now printed on startup
  • NATS handler errors are logged to console

Fixes

  • mongodb is now loaded lazily in validator — no crash if not installed

TypeScript

  • Added [action: string]: any index signature to all controller base classes to suppress "unused method" IDE warnings