A simple API to manage your contacts. This was created using Node, Express, SQLite and Knex. For testing, I'm using jest, and supertest. Heroku Postgress will be used to deploy to Heroku.
🏠 Homepage
npm install
npm start
Use Postman to view and manipulate routes
npm test
#AUTH
*****
Register To Use API: POST /api/users/register
*****
*ensure body settings are raw JSON*
JSON
[
<id of new entry>
]
*****
Log Into API: POST /api/users/login
*****
JSON
{
"message": `Welcome ${username}`
}
*****
Log Out Of API: GET /api/users/logout
*****
JSON
{
"message": `Sorry ${username}, you are NOT logged out, try again`
}
OR
{
"message": "Peace out, you have successfully logged out"
}
#CONTACTS - register and log
*****
List All Contacts: GET /api/contacts
*****
JSON
[
{
"id": 1,
"name": "Viola Davis",
"number": 3017660448,
"email": "[email protected]"
},
{
"id": 2,
"name": "Nell Carter",
"number": 2028999411,
"email": "[email protected]"
},
{
"id": 3,
"name": "Issa Rae",
"number": 4102229876,
"email": "[email protected]"
},
{
"id": 7,
"name": "Eartha Kitt",
"number": 9194899231,
"email": "[email protected]"
}
]
*****
List Contacts by Their ID: GET /api/contacts/<id>
*****
JSON
[
{
"id": 1,
"name": "Viola Davis",
"number": 3017660448,
"email": "[email protected]"
}
]
*****
Add a Contact: POST /api/contacts
*****
*ensure body settings are raw JSON*
JSON
[
<id of new entry>
]
*****
Edit a Contact: PUT /api/contacts/<id>
*****
JSON
{
"updated": <number of entries updated>
}
*****
Delete a Contact: DELETE /api/contacts/<id>
*****
JSON
{
"deleted": <number of entries deleted>
}
👤 Brandi Apetsi
- Website: BrandiApetsi.com
- Twitter: @DaBusyB
- Github: @DaBusyB
- LinkedIn: brandi-apetsi
Contributions and suggestions are welcome!
Give a ⭐️ if this project helped you!
Free to copy and or use
This README was generated with ❤️ by readme-md-generator