A collection of all my tech tests
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Roger Gonzalez 34717cd3b5 Initial commit 9 months ago
..
src Initial commit 9 months ago
test Initial commit 9 months ago
.env.example Initial commit 9 months ago
.eslintrc.json Initial commit 9 months ago
.gitignore Initial commit 9 months ago
.nycrc Initial commit 9 months ago
.prettierrc Initial commit 9 months ago
Installation docs.pdf Initial commit 9 months ago
LICENSE Initial commit 9 months ago
README.md Initial commit 9 months ago
package-lock.json Initial commit 9 months ago
package.json Initial commit 9 months ago

README.md

Goodgame Application test

Comes with:

  • ES6 support.
  • API documentation using Swagger.
  • ESLint for code linting.
  • Configuration management using dotenv.
  • Logging of requests with Winston.
  • Tests using Mocha/Chai.
  • Coverage report through nyc.

Check the application live

If you don't want to run it locally, just go to https://goodgame-test.herokuapp.com/docs/ and experiment with the API

Expert mode

Open a terminal and use the following command:

curl -X POST "https://goodgame-test.herokuapp.com/" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"amount\": 100}"

You can edit the amount directly on the command


Prerequisites

Setup

Install the dependencies and get started right away.

$ cd goodgame
$ npm install

Make a copy of .env.example as .env and update your application details and database credentials.

Environment variables description

  • NODE_ENV: The node environment
  • PORT: Application port. If not specified, it defaults to port 7777.
  • TEST_PORT: Port to run tests.
  • URL: The server's URL. Used by swagger docs explorer

This in an example of a .env file

NODE_ENV=development
PORT=7777
TEST_PORT=3333
URL=localhost

Starting the application

$ npm start

Navigate to http://localhost:7777/docs/ to verify the instalation.

Tests

If you have set the test database on the .env file, you can run the tests by using

$ npm run test