/smash-ladder-be

Backend code for https://github.com/ErikLarsson82/smash-ladder-fe

Primary LanguageJavaScript

HiQombo Smash Ultimate Ladder - Backend REST API using Postgres as DB

Backend code for https://github.com/ErikLarsson82/smash-ladder-fe

Deployed at https://hiqombo-ladder-be.herokuapp.com/

API:

/players
/matches
/schedule
/schedulefight
/resolvefight

Installation

Tested with node Postgres 11.6

Clone repository
npm install
npm run start

Deploy to heroku

Development

Local - Create .env file with this content

DATABASE_URL=localhost
DISABLE_SSL=DISABLED
SLACK_CB_URL=url

Remote - For connection to remote url

DATABASE_URL=find this URL at heroku
DISABLE_SSL=ENABLED
SLACK_CB_URL=url

Push to heroku - using .env file aswell
$ PGUSER=postgres PGPASSWORD=hej123 PGPORT=2800 heroku pg:push database_name postgresql-flexible-87882 --app hiqombo-ladder-be

Making backup of production database

Get dynamic Heroku CLI credentials, change date and run

$ PGUSER=postgres PGPASSWORD=hej123 PGPORT=2800 heroku pg:pull postgresql-flexible-87882 hiqombo-prod-16-jan-20 --app hiqombo-ladder-be

Upload local version

$ PGUSER=postgres PGPASSWORD=hej123 PGPORT=2800 heroku pg:push hiqombo-prod postgresql-flexible-87882 --app hiqombo-ladder-be

Slack integration

Set the SLACK_CB_URL environment variable to the target channel