2.0.0 • Published 8 years ago

hapio v2.0.0

Weekly downloads
25
License
MIT
Repository
github
Last release
8 years ago

hapio

Dependency Status devDependency Status Build Status Coverage Status Greenkeeper badge

A simple bridge plugin between HapiJS and SocketIO.

Plugin registration

const server = new Hapi.Server({
    port: 3000,
    host: 'localhost',
});

async function start() {
    try {
        await server.register(hapio, {
            serverOptions: {
                // socket.io options
            }
        });
        await server.start();
    } catch (e) {
        console.error(e);
    }
}
start();

Using hapio

const io = server.plugins.hapio.io;

io.on('connection', function(socket) {
    console.log(`${socket.id} connected !`);
    socket.on('test', function(e) {
        console.log('Test received !');
    });
});

hapio options

A great idea?

Do not hesitate to make a pull request

An issue with hapio?

Just open an issue on Github and I will fix it as soon as possible

2.0.0

8 years ago

1.4.0

8 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago