Created
October 19, 2015 12:36
-
-
Save danielb2/330b492a85c1f6aee786 to your computer and use it in GitHub Desktop.
Revisions
-
danielb2 created this gist
Oct 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ { "name": "foo", "version": "1.0.0", "description": "good log trial thing", "main": "./start.js", "author": "me", "dependencies": { "blipp": "2.x.x", "good": "6.x.x", "good-console": "5.x.x", "good-file": "^5.1.0", "hapi": "8.x.x", "hoek": "2.x.x", "purdy": "1.x.x", "wreck": "6.x.x" } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ var Hapi = require('hapi'); var Url = require('url'); var Wreck = require('wreck'); var server = new Hapi.Server(); server.connection({ host: 'localhost', port: 8000 }); var good = { options: { opsInterval: 5000, requestHeaders: true, requestPayload: true, reporters: [{ reporter: 'good-console', events: { error: '*', log: '*', request: '*', response: '*', wreck: '*' } }, { reporter: 'good-file', config: './wreck.log', events: { wreck: '*' } }] }, register: require('good') }; var handler = { proxy: { host: 'www.google.com.tw' } }; server.route({ method: 'GET', path: '/{url*}', config: { handler: handler } }); server.register([good, { register: require('blipp') }], function (err) { server.start(function (err) { }); });