mpp-server-dev2/index.js

28 lines
774 B
JavaScript
Raw Normal View History

2019-06-06 19:22:43 +02:00
//call new Server
global.WebSocket = require('ws');
global.EventEmitter = require('events').EventEmitter;
global.fs = require('fs');
global.createKeccakHash = require('keccak');
const AsyncConsole = require('asyncconsole')
2019-11-20 06:08:47 +01:00
global.isString = function(a){
return typeof a === 'string';
}
global.isBool = function(a){
return typeof a === 'boolean';
}
global.isObj = function(a){
return typeof a === "object" && !Array.isArray(a) && a !== null;
}
2019-06-06 19:22:43 +02:00
let Server = require("./src/Server.js");
2019-06-11 23:01:44 +02:00
let config = require('./src/db/config.json');
global.SERVER = new Server(config);
2019-06-12 17:35:22 +02:00
let console = process.platform == 'win32' ? new AsyncConsole("", input => {
2019-06-06 19:22:43 +02:00
try {
console.log(JSON.stringify(eval(input)));
} catch(e) {
console.log(e.toString());
}
2019-06-12 17:35:22 +02:00
}) : {};