3.0.0 • Published 7 years ago

vigour-state-json-server v3.0.0

Weekly downloads
67
License
ICS
Repository
github
Last release
7 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

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.0

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago