This is a Twitter api demo with minimal functionality. It has been deployed on Heroku at https://twitter-api-demo-heroku.herokuapp.com. The deployment is used by https://twitter-frontend-demo.herokuapp.com.
- Express + Mongoose(MongoDB)
- Validation by Joi
- Authentication and Authorization by JSON Web Token
- create a new user:
POSTto/api/userswithname,email, andpassword - get all users:
GETto/api/users - user login:
POSTto/api/authwithemailandpassword, and get a user object (with a JSON Web Token property named "token") in response
- create a new tweet:
POSTto/api/tweetswithcontentin body andx-auth-tokenin header - update a tweet:
PUTto/api/tweets/:idwithcontentin body andx-auth-tokenin header. The token should match the author of the tweet to be updated. - get all tweets:
GETto/api/tweets - get a tweet by id:
GETto/api/tweets/:id - delete a tweet:
DELETEto/api/tweets/:idwith andx-auth-tokenin header. The token should match the author of the tweet to be deleted.