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:
POST
to/api/users
withname
,email
, andpassword
- get all users:
GET
to/api/users
- user login:
POST
to/api/auth
withemail
andpassword
, and get a user object (with a JSON Web Token property named "token") in response
- create a new tweet:
POST
to/api/tweets
withcontent
in body andx-auth-token
in header - update a tweet:
PUT
to/api/tweets/:id
withcontent
in body andx-auth-token
in header. The token should match the author of the tweet to be updated. - get all tweets:
GET
to/api/tweets
- get a tweet by id:
GET
to/api/tweets/:id
- delete a tweet:
DELETE
to/api/tweets/:id
with andx-auth-token
in header. The token should match the author of the tweet to be deleted.