@koex/socket.io
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

socket.io

NPM version Coverage Status Dependencies Build Status license issues

socket.io for koa extend.

Install

$ npm install @koex/socket.io

Usage

import withSocketIO from '@koex/socket.io';

import * as Koa from 'koa';
const app = new Koa();
withSocketIO(app);

app.use(cors());

app.use(ctx => {
  ctx.body = 'Hello, World!';
});

// app.io is the socket.io instance
app.io.on('connection', socket => {
  // do something
});

app.listen(8000, '0.0.0.0', () => {
  console.log('koa server start at port: 8000');
});

Related

Dependencies (2)

Dev Dependencies (19)

Package Sidebar

Install

npm i @koex/socket.io

Weekly Downloads

6

Version

0.0.1

License

MIT

Unpacked Size

4.85 kB

Total Files

5

Last publish

Collaborators

  • uniquecolesmith