ws-stomp-server 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -76,14 +76,14 @@ import express from 'express';
76
76
  import { Stomp } from 'ws-stomp-server';
77
77
 
78
78
  const app = express();
79
- app.get('/send', (req, res) => {
79
+ app.get('/send', (_, res) => {
80
80
  Stomp.publish('/topic/test', JSON.stringify({ name: 'hello word!' }));
81
- res.status(200);
81
+ res.status(200).json({});
82
82
  });
83
83
  const server = app.listen(8080);
84
84
  Stomp.server(server, '/ws');
85
- Stomp.subscribe('/topic/test', (e) => {
86
- const body = e.body;
85
+ Stomp.subscribe('/topic/test', (message) => {
86
+ console.log(message.body);
87
87
  });
88
88
  ```
89
89
 
@@ -95,7 +95,9 @@ import { Client } from '@stomp/stompjs';
95
95
  const client = new Client({
96
96
  brokerURL: 'ws://localhost:8080/ws',
97
97
  onConnect: () => {
98
- client.subscribe('/topic/test', (message) => console.log(message.body);
98
+ client.subscribe('/topic/test', (message) => {
99
+ console.log(message.body);
100
+ });
99
101
  client.publish({ destination: '/topic/test', body: 'First Message' });
100
102
  },
101
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-stomp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ws-stomp-server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",