Live app: https://internet-movie-database-api.herokuapp.com/movies
POST /movies
GET /movies
POST /comments
GET /comments
More details here.
- Postgres (ver. 9.4 or newer)
- node.js
- Omdb api key
yarn install
cp .env.development.example .env.development
cp .env.test.example .env.test
By default app will use variables from file .env.development
if it exists. App is picking .env files based on NODE_ENV
enviroment variable, ex. .env.[NODE_ENV]
.
Example .env.development
file:
DB_USERNAME=docker
DB_PASSWORD=password
DB_DATABASE=internet_movie_database_api_test
DB_HOST=127.0.0.1
DB_PORT=5432
DB_MAX_CONNECTIONS=20 // optional
DB_MAX_IDLE_TIME=10000 // optional
LOG_SAVE=true // optional
LOG_FILE=combined.log // optional
LOG_LEVEL=info // optional, more about levels here https://www.npmjs.com/package/winston#logging-levels
OMDB_API_KEY=[your api key]
PORT=5000 // optional, default 5000
Save api key in .env.development
and .env.test
files
yarn start
Edit file docker-compose.yml
and paste your omdb api key
sudo docker-compose up
# Test code styles and app:
yarn test
# Test only app:
yarn run mocha
Eslint uses Airbnb style guide:
# Test code style:
yarn run lint
App is using sequelize cli
to menage database seeding and migrations:
sequelize db:migrate
- migrate tablessequelize db:seed:all
- seed tablessequelize db:migrate:undo:all
- drop migrated tables