0.1.6 • Published 15 days ago

vv-httpgate v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days 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.6

15 days ago

0.1.5

26 days ago

0.1.4

27 days ago

0.1.2

8 months ago

0.1.3

8 months ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago