pass in plug via envvar

This commit is contained in:
karl0ss 2019-07-14 11:19:29 +01:00
parent 57d97b0d9b
commit ef637349b1

View File

@ -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
],
};