Skip to content

Commit

Permalink
foirmats the structure
Browse files Browse the repository at this point in the history
  • Loading branch information
afzal442 committed Dec 21, 2023
1 parent df5a6d7 commit 8eb5d91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
21 changes: 11 additions & 10 deletions docs/pages/env-vars-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ weight: 50
Glee provides a few environment variables for you to customize the Glee application's behavior according to your specific requirements:
|Variable|Description|Example|
|---|---|---|
|GLEE_SERVER_NAMES|A comma-separated list of the servers to load on startup.|`GLEE_SERVER_NAMES=websockets,mosquitto`
|GLEE_SERVER_CERTS|A comma-separated list of `${serverName}:${pathToCertificateFile}`. These are the certificates to use when establishing the connection to the given server.|`GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt`
|GLEE_SERVER_VARIABLES|A comma-separated list of `${serverName}:${serverVariable}:${value}`. These are the values to use for each server variable.|`GLEE_SERVER_VARIABLES=websockets:namespace:public`
|GLEE_SERVER_NAMES|A comma-separated list of the servers to load on startup.|`GLEE_SERVER_NAMES=websockets,mosquitto`|
|GLEE_SERVER_CERTS|A comma-separated list of `${serverName}:${pathToCertificateFile}`. These are the certificates to use when establishing the connection to the given server.|`GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt`|
|GLEE_SERVER_VARIABLES|A comma-separated list of `${serverName}:${serverVariable}:${value}`. These are the values to use for each server variable.|`GLEE_SERVER_VARIABLES=websockets:namespace:public`|

## Configuring Glee

Expand Down Expand Up @@ -111,13 +111,14 @@ Inside the return statement, you can specify the following options:
These configurations apply to Glee itself, rather than any specific protocol.
|Field|Default|Description|
|--|--|--|
|glee.gleeDir|`.glee`|Sets the Glee directory. Your sources will be compiled here.|
|glee.lifecycleDir|`lifecycle`|Path to the directory that stores your [lifecycle events](./lifecycle-events.md).|
|glee.functionsDir|`functions`| Path to the directory that stores your [functions](./functions.md).|
|glee.asyncapiFilePath|`asyncapi.(yaml \| yml \| json)`| Path to your AsyncAPI file. |
|glee.logs| | glee logs channel and payload by default. you can change this behaviour for incoming and outgoing messages. |
|glee.logs.incoming| "all" | supported values are `channel-only` and `none`. |
|glee.logs.outgoing| "all" | supported values are `channel-only` and `none`. |
|glee.gleeDir|`.glee`|Sets the Glee directory. Your sources will be compiled here.
|glee.lifecycleDir|`lifecycle`|Path to the directory that stores your [lifecycle events](./lifecycle-events.md).
|glee.functionsDir|`functions`| Path to the directory that stores your [functions](./functions.md).
|glee.asyncapiFilePath|`asyncapi.(yaml \| yml \| json)`| Path to your AsyncAPI file.
|glee.logs| default | glee logs channel and payload by default. you can change this behaviour for incoming and outgoing messages.
|glee.logs.incoming| "all" | Supported values are `channel-only` and `none`.
|glee.logs.outgoing| "all" | Supported values are `channel-only` and `none`.

#### Generating Documentation
|Field|Description|
|--|--|
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/function-lifecycle-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Functions take a single argument, which is the event received from a broker or a
|headers|The headers/metadata of the received event.
|channel|The name of the channel/topic from which the event was read.
|serverName|The name of the server/broker from which the event was received.

Functions may return an object to tell Glee what to do next. For instance, the following example greets the user back:
```js
/* onHello.js */
Expand Down Expand Up @@ -75,7 +76,7 @@ export default async function ({
export const lifecycleEvent = 'onConnect'
```

Each file in the `lifecycle` directory must export a default async function and the `lifecycleEvent` field, which is the [name of the event](#list-of-events) you want to subscribe to. Optionally, your function can return an object following exactly the same syntax [as described in the functions documentation](functions.md).
Each file in the `lifecycle` directory must export a default async function and the `lifecycleEvent` field, which is the [name of the event](#list-of-events) you want to subscribe to. Optionally, your function can return an object following exactly the same syntax as described above in the functions definition.

## List of events

Expand Down

0 comments on commit 8eb5d91

Please sign in to comment.