Back end API with three requested endpoints.
tea_subs_api is a back end application api that manages the subscriptions statusses of customers and tea flavors within said subscriptions. It holds three endpoints currently that allows a front end user to call on them with provided information and see a proper return. This README will provide needed information to use this API as intended.
- Clone this repository to your local machine: 'git@github.com:Isaac3924/tea_subs_api.git'
- Install dependencies: 'bundle install'
- Configure the database by running 'rails db:setup'
- Seed the database by running 'rails db:seed' Here is a screenshot of the schema to further understand relations and attributes:
- Start the server by running 'rails server'
- Visit 'http://localhost:3000' in your web browser to confirm that the app is running.
- The API endpoints available are a POST to 'http://localhost:3000/api/v1/customers/1/subscriptions', a GET to 'http://localhost:3000/api/v1/customers/2/subscriptions', and a PATCH to 'http://localhost:3000/api/v1/subscriptions'.
- Use Postman to test the FIRST TWO endpoints as is for responses. The database should seed with the needed data in order to receive a JSON in return.
- For the third endpoint, you will need to provide a JSON body to receive a response. The expected format for the body is as follows:
{
"subscriptions": {
"title": "Example Subscription",
"price": 178.99,
"status": "active",
"frequency": "Time is not a one way street",
"tea_ids": [1, 2, 3]
}
}
This application is fairly straightforward. Three endpoints to return needed information. Can be further updated with extra endpoints, but for now, works as an MVP.
Isaac Alter – @MyLinkedIn – isaacalter3924@gmail.com