-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
44 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Environment Variables | ||
|
||
Glee provides a few environment variables for you to customize the experience: | ||
|
||
|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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
GLEE_SERVER_NAMES=mosquitto,websockets | ||
GLEE_SERVER_CERTS=mosquitto:mosquitto.org.crt | ||
# GLEE_USERNAME=testing | ||
# GLEE_PASSWORD=Test1ng! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { readFile } from 'fs/promises' | ||
import asyncapi from '@asyncapi/parser' | ||
import { getConstants } from './constants.js' | ||
|
||
export async function getParsedAsyncAPI() { | ||
const { ASYNCAPI_FILE_PATH } = getConstants() | ||
const asyncapiFileContent = await readFile(ASYNCAPI_FILE_PATH, 'utf-8') | ||
return asyncapi.parse(asyncapiFileContent) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { getParsedAsyncAPI } from './asyncapiFile.js' | ||
|
||
export async function getSelectedServerNames() { | ||
const parsedAsyncAPI = await getParsedAsyncAPI() | ||
|
||
if (!process.env.GLEE_SERVER_NAMES) { | ||
return parsedAsyncAPI.serverNames() | ||
} | ||
|
||
const arrayOfNames = process.env.GLEE_SERVER_NAMES.split(',') | ||
return parsedAsyncAPI.serverNames().filter(name => { | ||
return arrayOfNames.includes(name) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters