Heroku URL: https://movies-api-rb.herokuapp.com/
- Clone this repository
git clone https://github.com/anjoseb121/movies-api.git
- Run postgres locally
- Update your local database credentials in
app.rb
file - Install gems with
bundle install
- Run migrations with
bundle exec sequel -m db/migrations postgres://localhost/#{your database name}
- Run the project with
ruby app.rb
- Test your API!
Execute rspec
in root directory
URL: movies-api-rb.herokuapp.com/movies
TYPE: POST
PARAMS:
{
"name": "A movie name",
"description": "Lorem ipsum",
"days": "[1, 2, 3]",
"cover": cover file
}
RESPONSE:
{
"id": 23
}
URL: movies-api-rb.herokuapp.com/movies
TYPE: GET
PARAMS:
day: integer
Example: movies-api-rb.herokuapp.com/movies?day=2
URL: movies-api-rb.herokuapp.com/bookings
TYPE: POST
PARAMS:
{
"date": "2019-08-30",
"movie_id": 1
}
RESPONSE:
{
"id": 23
}
URL: movies-api-rb.herokuapp.com/bookings
TYPE: GET
PARAMS:
start_date: string
end_date: string
Example: movies-api-rb.herokuapp.com/bookings?start_date=2019-08-30&end_date=2019-08-30