Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryConnollyLIT committed Aug 6, 2019
1 parent 54f6877 commit 65bd797
Showing 1 changed file with 40 additions and 30 deletions.
70 changes: 40 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ You can use this service in two ways, running it locally or by hitting the deplo
### Quick Links

http://ec2-52-91-239-59.compute-1.amazonaws.com:3000/api/swag-docs

http://ec2-52-91-239-59.compute-1.amazonaws.com:3000/api/fetch/all

The endpoint is publically available at
Expand Down Expand Up @@ -99,51 +100,60 @@ http://ec2-52-91-239-59.compute-1.amazonaws.com:3000/api/fetch/allByActivity?act

The service can be run locally by cloning this repo and installing the AWS CLI and then in your terminal window running:
```bash
* aws configure
aws configure
```
You will be prompted for AWS access key and AWS secret access key. These are for accessing the DynamoDb (please contact the repo owner for these).
You will be prompted for Region (us-east-1), AWS access key and AWS secret access key. These are for accessing the DynamoDb (please contact the repo owner for these).
Then in your terminal window run:

```bash
* npm install
* npm start
npm install
npm start
```

You should see a notification in your terminal that your server is now running locally on port:3000. You can now hit this service in your browser using the following urls:

http://localhost:3000/api/swag-docs
* Provides swagger documentation for all the locally hosted endpoints
http://localhost:3000/api/swag-docs

Provides swagger documentation for all the locally hosted endpoints

http://localhost:3000/api/fetch/all

Returns all the dog collar responses in database
Caution - may cause performance issues if database is large

http://localhost:3000/api/fetch/allByCollarId?collarId=abc3

Returns all responses associated with a specific collar
Takes 'collarId' as a query param

http://localhost:3000/api/fetch/allByBarking?barking=low

Returns all responses with a specific level of barking
Takes 'barking' as a query param

http://localhost:3000/api/fetch/allByActivity?activity=low

Returns all responses with a specific level of activity
Takes 'activity' as a query param

http://localhost:3000/api/fetch/all
* Returns all the dog collar responses in database
* Caution - may cause performance issues if database is large
http://localhost:3000/api/fetch/allByLocation?location=37901

http://localhost:3000/api/fetch/allByCollarId?collarId=abc3
* Returns all responses associated with a specific collar
* Takes 'collarId' as a query param
Returns all responses within a specific zipcode
Takes 'location' as a query param

http://localhost:3000/api/fetch/allByBarking?barking=low
* Returns all responses with a specific level of barking
* Takes 'barking' as a query param
http://localhost:3000/api/fetch/SpecificCollarRespByID?collarId=abc1&collarResp=1

http://localhost:3000/api/fetch/allByActivity?activity=low
* Returns all responses with a specific level of activity
* Takes 'activity' as a query param
Returns a specific collar responses
Takes 'collarId' and 'collarResp' as query params

http://localhost:3000/api/fetch/allByLocation?location=37901
* Returns all responses within a specific zipcode
* Takes 'location' as a query param
http://localhost:3000/api/remove?collarId=abc3&collarResp=11

http://localhost:3000/api/fetch/SpecificCollarRespByID?collarId=abc1&collarResp=1
* Returns a specific collar responses
* Takes 'collarId' and 'collarResp' as query params
Removes a specific collar repsonses from the database
Takes 'collarId' and 'collarResp' as query params

http://localhost:3000/api/remove?collarId=abc3&collarResp=11
* Removes a specific collar repsonses from the database
* Takes 'collarId' and 'collarResp' as query params
http://localhost:3000/api/pushCollarData

http://localhost:3000/api/pushCollarData
* Returns a specific collar responses
* Takes 'collarId' and 'collarResp' as query params(this one requires a request object - see exmple above)
Returns a specific collar responses
Takes 'collarId' and 'collarResp' as query params(this one requires a request object - see example above)


0 comments on commit 65bd797

Please sign in to comment.