@sarcio/server-hmr
v0.2.0
Published
Applies approved Sarcio code fixes to a running Node.js service, with canary rollout and rollback.
Readme
@sarcio/server-hmr
Applies an approved Sarcio code fix to a running Node.js service without a restart, and lets a tester try the fix on their own traffic before everyone else gets it.
Setup guides and the full reference are in the Sarcio docs.
Install
npm install @sarcio/server-hmrstartStickyCluster({ workers, port })runs your service as a cluster in which a tester's requests (marked by thesarcio_canarycookie or thex-sarcio-canaryheader) go to one dedicated worker, and everyone else stays on the others.handle.seedCanary(payloads)gives the fix to that tester only;handle.rollout(payloads)gives it to every worker;handle.rollback(ids)puts the original code back.attachSarcioWorker(server, registry)andcreateNodeRegistry()are the worker side.
The integrity of every fix is checked before it is applied, and again in each worker.
License
Business Source License 1.1: production use to connect your own applications to a Sarcio subscription or trial is granted; offering a competing service is not. Each version converts to Apache-2.0 four years after its release.
