https://github.com/goenning/hangman-node
A simple hangman game made with JavaScript / Node.js
https://github.com/goenning/hangman-node
Last synced: 2 months ago
JSON representation
A simple hangman game made with JavaScript / Node.js
- Host: GitHub
- URL: https://github.com/goenning/hangman-node
- Owner: goenning
- Created: 2016-07-07T08:58:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-11T09:09:25.000Z (almost 9 years ago)
- Last Synced: 2025-02-13T14:24:20.336Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 275 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Technical requirements
You'll need Node.js 4+ or Docker.
## How to run it with Node.js
```
$ cd path/to/hangman
$ npm install
$ npm test
```If all went well, just run:
```
$ npm start
```Navigate to http://localhost:9090/ to start playing.
## How to run it with Docker
```
$ cd path/to/hangman
$ docker build -t hangman .
$ docker run -t -p 9090:9090 hangman
```Navigate to http://localhost:9090/ to start playing.
# Configuration
You can set custom settings by changing the `config.json` file.
The possible keys are `maxMisses` (integer) and `availableWords` (array of strings)# Bonus!
There is also a CLI for the game. Try it out:
```
$ cd path/to/hangman
$ npm install #if not yet installed
$ npm link # you may need sudo to run this
$ hangman # to see the instructions
```If you don't want to link it, it's also possible to run it directly with `node ./cli/index.js`.
# How to run it in a cluster
It's currently not possible, because `Hangman Server` relies on memory to store current game state.
It would be necessary to use a netword storage (like a database or cache service) to run it in a cluster.