Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multiple .env files #674

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/update-docs-in-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ jobs:
- name: Copy glee folder from Current Repo to Another
working-directory: ./website
run: |
mkdir -p ./pages/docs/tools/glee
rm -r ./pages/docs/tools/glee
mkdir -p ./pages/docs/tools/glee
printf "%s\ntitle: Glee\nweight: 06\n%s" "---" "---"> ../glee/docs/_section.md
mv ../glee/docs/pages/*.md ./pages/docs/tools/glee
mv ../glee/docs/pages/*.{md,jpg,png} ./pages/docs/tools/glee
- name: Commit and push
working-directory: ./website
run: |
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/env-vars-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ Glee provides a few environment variables for you to customize the Glee applicat
|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`|

### Support for multiple .env files
Glee has support for loading variables from `.env.local` into `process.env`.
This is useful for storing secret environment variables needed in development while keeping them out of the repository.

However, sometimes you might want to add some defaults for the `development` or `production` environment. You can do that by creating files with the following names:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please mention how the user can change the environment. (by setting NODE_ENV in their environment.)

`.env.development` or `.env.production`

`.env.local` always overrides any other existing `.env*` file.

## Configuring Glee

Glee comes with sensible defaults so you don't have to worry about configuration. However, sometimes you may want to change the behavior or customize Glee in different ways. For that purpose, you can use the `glee.config.js` file.
Expand Down
28 changes: 14 additions & 14 deletions docs/reference/classes/adapters_cluster_redis.default.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Instantiates a Glee Cluster adapter.

#### Defined in

[src/lib/cluster.ts:46](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L46)
[src/lib/cluster.ts:46](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L46)

## Properties

Expand All @@ -92,7 +92,7 @@ Instantiates a Glee Cluster adapter.

#### Defined in

[src/adapters/cluster/redis/index.ts:9](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L9)
[src/adapters/cluster/redis/index.ts:9](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L9)

___

Expand All @@ -102,7 +102,7 @@ ___

#### Defined in

[src/adapters/cluster/redis/index.ts:10](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L10)
[src/adapters/cluster/redis/index.ts:10](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L10)

___

Expand Down Expand Up @@ -186,7 +186,7 @@ ClusterAdapter.glee

#### Defined in

[src/lib/cluster.ts:100](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L100)
[src/lib/cluster.ts:100](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L100)

___

Expand All @@ -204,7 +204,7 @@ ClusterAdapter.instanceId

#### Defined in

[src/lib/cluster.ts:112](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L112)
[src/lib/cluster.ts:112](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L112)

___

Expand All @@ -222,7 +222,7 @@ ClusterAdapter.serverName

#### Defined in

[src/lib/cluster.ts:104](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L104)
[src/lib/cluster.ts:104](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L104)

___

Expand All @@ -240,7 +240,7 @@ ClusterAdapter.serverUrlExpanded

#### Defined in

[src/lib/cluster.ts:108](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L108)
[src/lib/cluster.ts:108](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L108)

## Methods

Expand All @@ -254,7 +254,7 @@ ClusterAdapter.serverUrlExpanded

#### Defined in

[src/adapters/cluster/redis/index.ts:24](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L24)
[src/adapters/cluster/redis/index.ts:24](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L24)

___

Expand All @@ -274,7 +274,7 @@ ___

#### Defined in

[src/adapters/cluster/redis/index.ts:67](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L67)
[src/adapters/cluster/redis/index.ts:67](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L67)

___

Expand Down Expand Up @@ -325,7 +325,7 @@ Connects to the remote server.

#### Defined in

[src/adapters/cluster/redis/index.ts:16](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L16)
[src/adapters/cluster/redis/index.ts:16](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L16)

___

Expand Down Expand Up @@ -353,7 +353,7 @@ The deserialized message.

#### Defined in

[src/lib/cluster.ts:158](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L158)
[src/lib/cluster.ts:158](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L158)

___

Expand Down Expand Up @@ -565,7 +565,7 @@ ___

#### Defined in

[src/adapters/cluster/redis/index.ts:12](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L12)
[src/adapters/cluster/redis/index.ts:12](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L12)

___

Expand Down Expand Up @@ -1009,7 +1009,7 @@ Sends a message to the remote server.

#### Defined in

[src/adapters/cluster/redis/index.ts:20](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/cluster/redis/index.ts#L20)
[src/adapters/cluster/redis/index.ts:20](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/cluster/redis/index.ts#L20)

___

Expand Down Expand Up @@ -1037,7 +1037,7 @@ The serialized message,

#### Defined in

[src/lib/cluster.ts:138](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/cluster.ts#L138)
[src/lib/cluster.ts:138](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/cluster.ts#L138)

___

Expand Down
48 changes: 24 additions & 24 deletions docs/reference/classes/adapters_http_client.default.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

#### Defined in

[src/lib/adapter.ts:43](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L43)
[src/lib/adapter.ts:43](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L43)

## Properties

Expand Down Expand Up @@ -174,7 +174,7 @@ Adapter.AsyncAPIServer

#### Defined in

[src/lib/adapter.ts:184](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L184)
[src/lib/adapter.ts:184](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L184)

___

Expand All @@ -192,7 +192,7 @@ Adapter.channelAddresses

#### Defined in

[src/lib/adapter.ts:200](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L200)
[src/lib/adapter.ts:200](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L200)

___

Expand All @@ -210,7 +210,7 @@ Adapter.channelNames

#### Defined in

[src/lib/adapter.ts:192](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L192)
[src/lib/adapter.ts:192](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L192)

___

Expand All @@ -228,7 +228,7 @@ Adapter.connections

#### Defined in

[src/lib/adapter.ts:204](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L204)
[src/lib/adapter.ts:204](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L204)

___

Expand All @@ -246,7 +246,7 @@ Adapter.glee

#### Defined in

[src/lib/adapter.ts:176](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L176)
[src/lib/adapter.ts:176](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L176)

___

Expand All @@ -264,7 +264,7 @@ Adapter.operationIds

#### Defined in

[src/lib/adapter.ts:196](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L196)
[src/lib/adapter.ts:196](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L196)

___

Expand All @@ -282,7 +282,7 @@ Adapter.parsedAsyncAPI

#### Defined in

[src/lib/adapter.ts:188](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L188)
[src/lib/adapter.ts:188](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L188)

___

Expand All @@ -300,7 +300,7 @@ Adapter.serverName

#### Defined in

[src/lib/adapter.ts:180](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L180)
[src/lib/adapter.ts:180](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L180)

___

Expand All @@ -318,7 +318,7 @@ Adapter.serverUrlExpanded

#### Defined in

[src/lib/adapter.ts:208](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L208)
[src/lib/adapter.ts:208](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L208)

## Methods

Expand All @@ -338,7 +338,7 @@ Adapter.serverUrlExpanded

#### Defined in

[src/adapters/http/client.ts:67](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L67)
[src/adapters/http/client.ts:67](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L67)

___

Expand All @@ -360,7 +360,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:97](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L97)
[src/adapters/http/client.ts:97](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L97)

___

Expand All @@ -380,7 +380,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:82](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L82)
[src/adapters/http/client.ts:82](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L82)

___

Expand All @@ -400,7 +400,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:92](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L92)
[src/adapters/http/client.ts:92](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L92)

___

Expand All @@ -422,7 +422,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:37](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L37)
[src/adapters/http/client.ts:37](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L37)

___

Expand All @@ -442,7 +442,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:123](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L123)
[src/adapters/http/client.ts:123](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L123)

___

Expand All @@ -463,7 +463,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:117](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L117)
[src/adapters/http/client.ts:117](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L117)

___

Expand All @@ -483,7 +483,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:105](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L105)
[src/adapters/http/client.ts:105](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L105)

___

Expand Down Expand Up @@ -534,7 +534,7 @@ Connects to the remote server.

#### Defined in

[src/adapters/http/client.ts:17](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L17)
[src/adapters/http/client.ts:17](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L17)

___

Expand Down Expand Up @@ -663,7 +663,7 @@ ___

#### Defined in

[src/lib/adapter.ts:221](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L221)
[src/lib/adapter.ts:221](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L221)

___

Expand Down Expand Up @@ -708,7 +708,7 @@ Returns a list of the channels a given adapter has to subscribe to.

#### Defined in

[src/lib/adapter.ts:237](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L237)
[src/lib/adapter.ts:237](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L237)

___

Expand Down Expand Up @@ -790,7 +790,7 @@ ___

#### Defined in

[src/adapters/http/client.ts:14](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L14)
[src/adapters/http/client.ts:14](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L14)

___

Expand Down Expand Up @@ -1232,7 +1232,7 @@ ___

#### Defined in

[src/lib/adapter.ts:212](https://github.com/asyncapi/glee/blob/8d4f707/src/lib/adapter.ts#L212)
[src/lib/adapter.ts:212](https://github.com/asyncapi/glee/blob/dd53e26/src/lib/adapter.ts#L212)

___

Expand All @@ -1258,7 +1258,7 @@ Sends a message to the remote server.

#### Defined in

[src/adapters/http/client.ts:27](https://github.com/asyncapi/glee/blob/8d4f707/src/adapters/http/client.ts#L27)
[src/adapters/http/client.ts:27](https://github.com/asyncapi/glee/blob/dd53e26/src/adapters/http/client.ts#L27)

___

Expand Down
Loading