@asyncapi/template-js-websocket-client
v0.0.1
Published
This is a template generating JavaScript websocket client
Downloads
82
Readme
JavaScript WebSocket Client
You can test this template:
- Clone the project and run
npm install - Navigate to
packages/templates/clients/js/websocket - Install with
npm installand run test withnpm run test - Start example script that uses a client library generated by the test:
node example.js
By default this is testing against Postman echo service. You can modify
packages/templates/clients/js/websocket/example.jsand change first line toconst WSClient = require('./tests/temp/snapshotTestResult/client-hoppscotch.js');and runnode example.jsagain. You will see example still works but agains different API. This is possible as both AsyncAPI documents have the same name of operation for sending messages:sendEchoMessageso each client generated has the same API.
