@asyncapi/cli 1.8.3 → 1.8.4

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.
@@ -2,12 +2,26 @@ This is a [Glee](https://github.com/asyncapi/glee) project bootstrapped with the
2
2
 
3
3
  ## Getting Started
4
4
 
5
- First, run the development server:
5
+ 1) Install Dependencies:
6
+
7
+ ```bash
8
+ npm install --ignore-scripts
9
+ ```
10
+
11
+
12
+
13
+ 2) run the development server:
6
14
 
7
15
  ```bash
8
16
  npm run dev
9
17
  ```
10
18
 
19
+ 3) send some text to the websocket server at `ws://0.0.0.0:3000/hello`
20
+
21
+ ```bash
22
+ websocat ws://0.0.0.0:3000/hello
23
+ Hi!
24
+ ```
11
25
  You can start editing the API by modifying `functions/onHello.js` and `asyncapi.yaml`. The server auto-updates as you edit the file.
12
26
 
13
27
  ## Learn More
@@ -8,7 +8,7 @@ servers:
8
8
  protocol: ws
9
9
  channels:
10
10
  hello:
11
- address: hello
11
+ address: /hello
12
12
  messages:
13
13
  hello:
14
14
  $ref: '#/components/messages/hello'
@@ -17,11 +17,12 @@ operations:
17
17
  action: receive
18
18
  channel:
19
19
  $ref: '#/channels/hello'
20
- reply:
21
- channel:
22
- $ref: '#/channels/hello'
20
+ sendHello:
21
+ action: send
22
+ channel:
23
+ $ref: '#/channels/hello'
23
24
  components:
24
25
  messages:
25
26
  hello:
26
27
  payload:
27
- type: string
28
+ type: string
@@ -0,0 +1,11 @@
1
+ import { GleeFunctionReturn } from "@asyncapi/glee"
2
+
3
+ export default async function (event): Promise<GleeFunctionReturn> {
4
+ return {
5
+ send: [{
6
+ payload: `Hello from Glee! You said: '${event.payload}'.`,
7
+ channel: "hello",
8
+ server: "websockets"
9
+ }]
10
+ }
11
+ }