mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-05-19 21:16:20 +01:00
pass in plug via envvar
This commit is contained in:
parent
57d97b0d9b
commit
ef637349b1
13
Example.js
13
Example.js
@ -4,16 +4,21 @@ const url = require('url');
|
||||
|
||||
const httpPort = 3000;
|
||||
|
||||
const table =
|
||||
process.env.plugArray.split(",") //["key:value","key:value"]
|
||||
.map(pair => pair.split(":")); //[["key","value"],["key","value"]]
|
||||
|
||||
const plugArray = {};
|
||||
table.forEach(([key,value]) => plugArray[key] = value);
|
||||
|
||||
|
||||
// Create a settings object to pass PK key and map sockets to names
|
||||
const settings = {
|
||||
LOG_PACKET: true, //Show incoming packet data from the socket
|
||||
ORVIBO_KEY: process.env.orviboPK, // put your PK key here as plain text (See Readme)
|
||||
plugInfo : [
|
||||
// Add uid and a name so you can easily identify the connected sockets
|
||||
{
|
||||
uid :'5ccf7f22fba4',
|
||||
name: "3D Printer"
|
||||
},
|
||||
plugArray
|
||||
],
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user