UNPKG

decentralized-internet

Version:

An NPM library of programs to create decentralized web and distributed computing projects

1 lines 583 B
var Hapi=require("hapi");const getConfigFile=function(){try{return require(process.cwd()+"/conf.my.test.json")}catch(r){return require(process.cwd()+"/conf.test.json")}};var conf=getConfigFile(),server=new Hapi.Server;server.connection({host:conf.host,port:conf.port});var plugins=[];Object.keys(conf.plugins).forEach(function(r){var e={};e.register=require(r),e.options=conf.plugins[r],plugins.push(e)}),server.register(plugins,function(r){if(r)throw r}),server.start(function(){server.connections.forEach(function(r){console.log("info","server is listening port: "+r.info.uri)})});