This project is an express API. This API currently has a POST endpoint to create a new piece of advice, and a GET endpoint to retreive all advice in the database.
See it deployed here: https://pacific-hamlet-18372.herokuapp.com/
Checkout the frontend and submit advice here: https://mnhollandplum.github.io/magic_8_ball/
- Clone this repository and rename the repository to anything you'd like in one command:
git clone [email protected]:mnhollandplum/magic_8_ball_api
Visit: http://localhost:3000/ to run the application
- GET /api/v1/slips
[
{
"id": 1,
"advice": "Think before you speak. Read before you think.",
"created_at": "2019-02-27T03:09:07.781Z",
"updated_at": "2019-02-27T03:09:07.781Z"
},
{
"id": 2,
"advice": "Do not pray for an easy life, pray for the strength to endure a difficult one.",
"created_at": "2019-02-27T04:00:07.413Z",
"updated_at": "2019-02-27T04:00:07.413Z"
},
{
"id": 3,
"advice": "Love is the only way",
"created_at": "2019-02-27T04:12:41.545Z",
"updated_at": "2019-02-27T04:12:41.545Z"
},
{
"id": 4,
"advice": "To handle yourself, use your head; to handle others, use your heart.",
"created_at": "2019-02-27T05:49:56.214Z",
"updated_at": "2019-02-27T05:49:56.214Z"
},
{
"id": 5,
"advice": "To handle yourself, use your head; to handle others, use your heart.",
"created_at": "2019-02-27T05:51:00.623Z",
"updated_at": "2019-02-27T05:51:00.623Z"
},
{
"id": 6,
"advice": "To handle yourself, use your head; to handle others, use your heart.",
"created_at": "2019-02-27T05:51:01.739Z",
"updated_at": "2019-02-27T05:51:01.739Z"
}
]
- POST /api/v1/slips
{ "slip": { "advice": "This is the best advice you've ever recieved"}
To contribute to this project please fork and submit a pull request.
- JavaScript
- Express
- PostgreSQL
- Node.js
- Knex