/twitter-clone-api

It's a simple api to a tweeter's clone application :bird:

Primary LanguageJavaScriptMIT LicenseMIT

Twitter API 🐦

How to use

Cloning and runing

  • Cloning git repository and entry in repository
$  git clone https://github.com/joaaomanooel/twitter-clone-api.git

after

$  cd twitter-clone-api
  • Install Dependencies
$  npm i

or

$  yarm install
  • Runing API
$  npm start

or with nodemon

$  npm run dev

Accessing

Tweet:

URL

localhost:3000/api/v1/tweet/

Http Methods

  • Get All

    Methods Params
    GET NULL

Rsponse example:

[
  {
    "author": "João Manoel Neto",
    "content": "Testing response =)",
    "createdAt": "2018-11-16T21:59:33.828Z",
    "likes": 1,
    "__v": 0,
    "_id": "5bef3df10010962795f0d54a"
  }
]
  • Create a new

    Methods Params
    POST NULL

Expected body request:

[
  {
    "author": "Example author",
    "content": "Example tweet",
  }
]

Likes:

URL

localhost:3000/api/v1/likes/:id

  • Like a tweet

    Methods Params
    PUT Tweet ID (objectId)

Example request:

localhost:3000/api/v1/likes/5bef3df10010962795f0d54a

Rsponse example:

{
  "author": "João Manoel Neto",
  "content": "Testing response =)",
  "createdAt": "2018-11-16T21:59:33.828Z",
  "likes": 2,
  "__v": 0,
  "_id": "5bef3df10010962795f0d54a"
}

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

João Manoel Neto
João Manoel Neto

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details