const createServer = require('vigour-state-json-server')
const s = require('vigour-state/s')
const state = s({ hello: 'world' })
const http = require('http')
const server = createServer(
state,
8080,
100,
(prop) => prop.key !== 'secrect'
)
http.request({
host: 'localhost',
port: 8080
}, (res) => {
var data = ''
res.on('data', (chunk) => { data += chunk })
res.on('end', () => {
console.log(JSON.parse(data))
})
}).end()