Skip to content

Latest commit

 

History

History
executable file
·
49 lines (34 loc) · 1.49 KB

README.md

File metadata and controls

executable file
·
49 lines (34 loc) · 1.49 KB

Random League APIs

Node Version

  • node v12.14.0

Tools

  • Node.js/TypeScript
  • Express
  • MongoDB
  • Redis
  • Docker
  • Jest

Starting the App

  • Create and Populate the .env file in the root directory with the appropriate environment variables.

Starting Locally (without Docker)

  • Run yarn from the root of the directory to install the required dependencies.
  • You should have redis installed on your computer. Run redis-server to start up redis.
  • Run yarn start-dev to start the app with ts-node

Starting with docker

  • Update the .env file with the following variables.

    • REDIS_URL=redis://redis:6379
    • MONGO_URI=mongodb://mongo:27017/random-league
  • Run yarn build

  • Run docker build . -t e.g docker build . -t random-league

  • Run docker-compose up from the root directory.

  • Run docker ps from the root directory (in another terminal window) to get the available port.

Testing

  • All tests cannot be run at once because of the database deoendency.
  • Each test file has to be run on its own i.e.
    • Run yarn test users.test.ts
    • yarn test teams.test.ts
    • yarn test fixtures.test.ts