/open-hockey-api

Open Source Hockey GraphQL API

Primary LanguageTypeScript

Apollo Server Nest Logo GraphQL Logo

Description

Open Source Hockey Api For NHL Statistics

Installation

$ npm install

Running the Application

Node

# development (watch mode)
$ npm run start:dev:watch

# debug
$ npm run start:debug

# production mode
$ npm run build && npm run start

Docker

## Build

# dev
$ docker build -f dev.Dockerfile -t open-hockey-api-dev .

# prod
$ docker build -f Dockerfile -t open-hockey-api .

## Run

# dev
$ docker run -p 3000:3000 -v "$PWD":/app -v /app/node_modules -v /app/dist open-hockey-api-dev

# prod
$ docker run -p 3000:3000 open-hockey-api

Running Dependencies

Redis (Using Docker)

# Run redis
$ docker run --name open-hockey-api-redis -p 6379:6379 -d redis

# Connect to redis
$ docker exec -it open-hockey-api-redis sh
$ redis-cli

# test connection
$ ping
# show all keys
$ keys *
# monitor activity
$ monitor

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deployed Instances

Note: Both instances running on free-tier of Heroku. Servers may need a minute to spin up if currently idle.

Dev

  • URL: https://open-hockey-api-dev.herokuapp.com/graphql
  • Playground Enabled: yes

Prod

  • URL: https://open-hockey-api.herokuapp.com/graphql
  • Playground Enabled: no