@cheep/transport-nats
v0.2.0
Published
Basic example:
Downloads
11
Readme
NATS transport for Cheep
Basic example:
import { NatsTransport } from '@cheep/transport-nats'
const transport = new NatsTransport({
moduleName: 'Test',
natsServerUrls: ['nats://127.0.0.1:1222'],
})
await transport.init()
transport.on('PING', async () => 'PONG')
await transport.start()
const result = await transport.execute({
route: 'PING',
payload: {},
})
expect(result).toBe('PONG')
await transport.dispose()