0.1.8 • Published 10 months ago

vv-httpgate v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

For backend NodeJS. Simple lib for work with RestAPI and Server Side Event

License

MIT

Install

npm i vv-httpgate

Example

See full example in directory /demo. Small example:

import { Create as CreateHttpGate } from 'vv-httpgate'

const httpGate = CreateHttpGate({url: 'localhost:8080'})

httpGate.onError(error => console.error(error))

httpGate.onRequest(request => {
    request.reply(200, `hello from api`)
})

httpGate.onServerEvent(event => {
    event.reply(`hello from api`, (error, isOpened) => {
        if (error) {
            console.error(error)
        }
    })
    event.onClose(() => {
        console.log('event connection closed')
    })
})

httpGate.start(addr => {
    console.log(addr)
})
0.1.8

10 months ago

0.1.7

11 months ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.2

2 years ago

0.1.3

2 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

4 years ago

0.0.7

3 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago