hackbox-server

0.0.3 • Public • Published

hackbox-server

A Jackbox inspired framework for creating party games - server component.

Usage

const hackbox = require("hackbox-server");

Using Express

const express = require("express");
const path = require("path");
const hackbox = require("hackbox-server");
const gameReference = require("./gameReference");
 
const port = process.env.PORT || 8080;
const app = express();
app.use(express.static("build"));
 
app.get("/", function(req, res) {
  res.sendFile(path.join("build", "index.html"));
});
 
hackbox({ app, port }, gameReference);

Game Reference

module.exports = {
  gameTypes: ["demo"],
  demo: {
    gameLength: 60000,
    validActionIds: [0, 1],
    description: `This is the description of the game. You have 60 seconds to compete`
  },
  actions: {
    0: { actionName: "action1" },
    1: { actionName: "action2" }
  }
};

Package Sidebar

Install

npm i hackbox-server

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

9.13 kB

Total Files

9

Last publish

Collaborators

  • tomalama