This portion of the app is a part of a take home challenge for YearOne
You will need and API_KEY
from https://www.omdbapi.com/ in order for this app to properly work.
See the frontend repo here.
To run this project, you will need to add the following environment variables to your .env
file
API_KEY
and optionally:
NODE_ENV
SECRET_KEY
Clone the project
git clone https://github.com/brian-trann/yearone-challenge-backend.git
Go to the project directory
cd yearone-challenge-backend
Install dependencies
npm install
Initialize the PostgreSQL Database
- Make sure you have PostgreSQL installed
- NOTE: running the next command will DROP
yearone_takehome
andyearone_takehome_test
databases, if they exist.
psql < yearone.sql
Start the server
npm run start
GET /movies/search
Query | Type | Description |
---|---|---|
title |
string |
Required. A title to search for |
movies/search/?title=${title}
GET /movies/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of item to fetch |
POST /movies/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of item to fetch |
Query | Type | Description |
---|---|---|
command |
string |
Required. like or dislike |
movies/${id}?command=dislike
movies/${id}?command=like
Column | Type | Description | Default |
---|---|---|---|
id |
string |
PRIMARY KEY. ID of movie | |
likes |
integer |
Number of likes | 0 |
dislikes |
integer |
Number of dislikes | 0 |
Client: React
Server: Node, Express