Glee expects your project to have some files and folders with special names. The best way to get started with Glee is using AsyncAPI CLI and running asyncapi new glee
, which sets up everything automatically for you.
├─ functions (required)
│ ├─ onHello.js
│ └─ ...
├─ lifecycle (optional)
│ ├─ onConnect.js
│ └─ ...
├─ .env (optional)
├─ asyncapi.(yaml | yml | json) (required)
├─ glee.config.js (optional)
├─ package.json (required)
File/Directory | Description |
---|---|
functions | Required. This directory contains all the functions that Glee must execute when it receives a message from the server. Each file must export a default async function. Read more about the functions signature. |
lifecycle | This directory contains application lifecycle functions. These functions will be executed when certain events happen in the application. E.g., onConnect , onServerReady , onDisconnect , etc. Read the full list of lifecycle events. |
.env | The environment variables of your application. Read more about the Glee environment variables. DO NOT PUT SECRETS HERE. |
asyncapi.(yaml | json |
glee.config.js | The Glee configuration file. Read more about how to use this file. |
package.json | Required. The Node.js package definition file. Make sure you include @asyncapi/glee as a dependency and add two scripts: dev and start . They should be running glee dev and glee start respectively. |