Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reekoheek/node-bono-io
The node-bono socket.io connection
https://github.com/reekoheek/node-bono-io
Last synced: 23 days ago
JSON representation
The node-bono socket.io connection
- Host: GitHub
- URL: https://github.com/reekoheek/node-bono-io
- Owner: reekoheek
- License: mit
- Created: 2017-03-03T08:45:11.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T09:00:15.000Z (almost 8 years ago)
- Last Synced: 2024-11-12T23:36:28.574Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 159 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xinix - bono-io - Bono socket.io connection - [reekoheek](https://github.com/reekoheek) (Grouping / Node)
README
# node-bono-io
The node-bono socket.io connection
## Install
```javascript
npm i reekoheek/bono-io
```## Configuration
Server configuration:
```javascript
const http = require('http');
const Bundle = require('bono');
const app = new Bundle();app.get('/', ctx => {
ctx.body = 'Hello world!';
})const server = http.Server(app.callback());
require('bono-io/server')(app).attach(server);
server.listen(3000, () => console.log('Listening at http://localhost:3000/'));
```Client configuration:
```html
Bono IO
(async () => {
// set default headers
io.socket.setHeaders({
'Authorization': 'Bearer xxx',
});let result = await io.socket.get('/');
console.log(result);
})();
```