0.1.4 • Published 5 years ago

hestia.io v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

hestia.io

npm version

Features

Hestia.io is a web app framework that manages instances of multi-user real-time apps.

It consists of

Installation

npm install --save hestia.io

Usage

Hestia manages sockets with Socket.IO, and has a similar interface for handling events. The main difference is that the socket which triggered the event is sent as the first argument to the handler function.

const express = require('express');
const app = express();
const http = require('http').createServer(app);

// Initialize hestia
const h = require('hestia.io')(http);

// Provide client-side app
app.use(express.static(__dirname + '/app/client.js'));

h.on('join', function(socket, data) {
  var roomID = h.createRoom();
  h.addPlayer({});

  // Start server-side app
  h.joinApp(roomID, 'myApp', __dirname + '/app/server.js');
  socket.emit('joined');
});

http.listen(5000);

Documentation

Check out the docs here!

Testing

npm test

The test suite uses Jest, and runs tests located in test directory.

License

MIT

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago