UNPKG

decentralized-internet

Version:

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

1 lines 866 B
const Hapi=require("hapi");var hapiauth={};hapiauth.register=require("hapi-auth-jwt"),hapiauth.options={};var hapijwtcouch={};hapijwtcouch.register=require("../index"),hapijwtcouch.options={privateKey:"SomeRandomKey123",saltRounds:10,algorithm:{algorithm:"HS256"},algorithms:{algorithms:["HS256"]},mailer:{nodemailer:"nodemailer-stub-transport",from:"Clusterpost <clusterpost@gmail.com>"},userdb:{hostname:"http://localhost:5984",database:"hapijwtcouch"}};var plugins=[hapiauth,hapijwtcouch],server=new Hapi.Server;server.connection({port:"3000"}),plugins.push({register:require("good"),options:{reporters:[{reporter:require("good-console"),events:{log:"*",response:"*"}},{reporter:require("good-file"),events:{ops:"*"},config:"all.log"}]}}),server.register(plugins,function(e){if(e)throw e;server.start(function(e){console.log("server running",server.info.uri)})});