A simple jwt based mock authentication in nodeJs as well as poker game. Demo
This is a Node.js based application.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
Once node installation is done.
Download or clone the project:
$ https://github.com/shubhamV123/webGame.gitInstall dependencies:
$ npm installStart the server:
If you have installed nodemon then simply type:
$ nodemonFind more information about nodemon nodemon.
Or else simply type:
$ node index.jsSince it is a mock authentication. You can either use any of these credentials for login:
name: 'john123',
password: '12345' or
name: 'test',
password: 'test This app is centralized with logging system.This app uses simple and universal logging library i.e winston.So just dont use console.log as it would not be benficial for debugging/monitoring your application.This app logs all your logging action which you want and it also saves your logs for future reference.Besides this it generate two log files: One contain all logs and another contain only error logs.
More information you can find here
To know more information about how to get a Node.js application into a Docker container.Follow this link. As this app contain docker file you can build your docker image and run this image in docker container. To build docker image of this:
docker build -t node-web-app(or any name which your want) . To run this docker image:
docker run -p 8081:3000 -d node-web-app((or name which you set)) This app uses mocha and chai to generate test cases and istanbul for code coverage. To run test suite:
$ npm test or mocha To run code coverage:
$ npm run coverage