3.0.0 • Published 9 years ago

vigour-state-json-server v3.0.0

Weekly downloads
67
License
ICS
Repository
github
Last release
9 years ago

vigour-state-json-server

Build Status js-standard-style npm version Coverage Status

  const createServer = require('vigour-state-json-server')
  const s = require('vigour-state/s')
  const state = s({ hello: 'world' })
  const http = require('http')
  // state, port, queuing-interval, filter
  const server = createServer(
    state,
    8080,
    100,
    // filters response
    (prop) => prop.key !== 'secrect'
  )

  //example request
  http.request({
    host: 'localhost',
    port: 8080
  }, (res) => {
    var data = ''
    res.on('data', (chunk) => { data += chunk })
    res.on('end', () => {
      console.log(JSON.parse(data)) // → { hello: 'world' }
    })
  }).end()
3.0.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.0

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago