Created
July 30, 2017 05:00
-
-
Save ironman9967/1c7b23e8e13a1d3277662b7a0ebe8a1b to your computer and use it in GitHub Desktop.
node simple http
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 characters
import Hapi from 'hapi' | |
import Good from 'good' | |
const { | |
connection, | |
register, | |
route, | |
start | |
} = new Hapi.Server() | |
connection({ | |
port: '9967' | |
}) | |
register({ | |
register: Good, | |
options: { | |
ops: { | |
interval: 1000 | |
}, | |
reporters: { | |
myConsoleReporter: [{ | |
module: 'good-squeeze', | |
name: 'Squeeze', | |
args: [{ log: '*', response: '*' }] | |
}, { | |
module: 'good-console' | |
}, 'stdout'], | |
myFileReporter: [{ | |
module: 'good-squeeze', | |
name: 'Squeeze', | |
args: [{ ops: '*' }] | |
}, { | |
module: 'good-squeeze', | |
name: 'SafeJson' | |
}, { | |
module: 'good-file', | |
args: ['./log.txt'] | |
}] | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment