- Install NodeJS
- Clone the repository to local.
- Install libraries:
npm install
- Run:
npm start
By the default the server listens on port 1337.
This is very simple game server using NodeJS
- Only one API is exposed
/casino
This returns
- Random generated number array of size 3.
- A Bonus feature capability determined by flags
true
orfalse
. - Result of the game determined as
Big Win!!!
,Small Win!
,No Win.
.
Big Win!!!
- When all the random generated numbers are equal.Small Win!!
- When only two of the random generated numbers are equal.No Win!
- When none of the random generated numbers are equal.
A Sample response would look like this.
[{"values":[1,1,5]},{"bonus":false},{"result":"Small Win"}]
JavaScript Standard Style is been used for styling and intendation.
- Run
npm test
This executes standard --fix
from package.json
scripts
Unit Testing is enabled using mocha and chai.
- Run:
npm test
This executes npm run-script prepare-test && standard --fix && mocha test/out/**spec.js
from package.json
scripts
prepare-test
does the es6 to es5 conversion.mocha
is used for unit testing.
Feel free to report any bugs. I will be more than happy to fix them right away.