adding args and set_globals
This commit is contained in:
parent
c05e260b51
commit
80b9d36287
9
args/config-sample.json
Normal file
9
args/config-sample.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"secret": "Secret_For_Session__Enter_A_Strong_String(Text/Password)",
|
||||
"port": "8080",
|
||||
|
||||
"sql_user": "mySQL_user",
|
||||
"sql_pwd": "mySQL_password",
|
||||
"sql_db": "supernode",
|
||||
"sql_host": "localhost"
|
||||
}
|
||||
37
args/param-default.json
Normal file
37
args/param-default.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"screen": {
|
||||
"height": 1160,
|
||||
"width": 2000,
|
||||
"colorDepth": 24,
|
||||
"availHeight": 1080,
|
||||
"availWidth": 1920,
|
||||
"pixelDepth": 24
|
||||
},
|
||||
"navigator": {
|
||||
"userAgent": "Node/14.17.3 (Linux; aarch64; arm)",
|
||||
"plugins": [{
|
||||
"name": "MySQL",
|
||||
"filename": "mysql",
|
||||
"description": "A node.js driver for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed."
|
||||
}, {
|
||||
"name": "WebSocket",
|
||||
"filename": "ws",
|
||||
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js"
|
||||
}, {
|
||||
"name": "Node fetch",
|
||||
"filename": "node-fetch",
|
||||
"description": "A light-weight module that brings window.fetch to node.js"
|
||||
}],
|
||||
"mimeTypes": [{
|
||||
"description": "",
|
||||
"type": "application/pdf",
|
||||
"suffixes": "pdf"
|
||||
}],
|
||||
"cookieEnabled": true,
|
||||
"language": "en-US"
|
||||
},
|
||||
"history": {
|
||||
"length": 512
|
||||
},
|
||||
"location": "protocol://subdomain.example.domain/path"
|
||||
}
|
||||
14
src/set_globals.js
Normal file
14
src/set_globals.js
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
//fetch for node js (used in floBlockchainAPI.js)
|
||||
global.fetch = require("node-fetch");
|
||||
|
||||
//Set browser paramaters from param.json (or param-default.json)
|
||||
var param;
|
||||
try {
|
||||
param = require('../args/param.json');
|
||||
} catch {
|
||||
param = require('../args/param-default.json');
|
||||
} finally {
|
||||
for (let p in param)
|
||||
global[p] = param[p];
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user