Skip to content

EXAMPLE: Token-based authentication RESTful API that posts a new Tweet to your Tweeter account. Controller tests included.

Notifications You must be signed in to change notification settings

ruelasvh/twitterapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Token‐based authentication API that creates a new Tweet (example) to your Twitter account via API.

  • Rails version 5.1.3

  • Ruby version 2.4.1

  • How to run the test suite: rspec

How to use this application:

POST /register

curl -X POST https://immense-thicket-79088.herokuapp.com/register -d "email=example@mail.com&password=123123123"

Response

{ "message": "Successfully created user" }

POST /auth/login

curl -X POST https://immense-thicket-79088.herokuapp.com/auth/login -d "email=example@mail.com&password=123123123"

Response

{ "message": " #{YOUR_API_TOKEN}" }

POST /tweet

curl -H "Content-Type: application/json" -H "Authorization: Bearer #{YOUR_API_TOKEN}" -X POST https://immense-thicket-79088.herokuapp.com/tweet -d '{"message":"I love tweeting"}'

Response

{ "message": "Your tweet has been posted!" }

GET /tweets

curl -H "Authorization: Bearer #{YOUR_API_TOKEN}" -X GET https://immense-thicket-79088.herokuapp.com/tweets

Response

[{ "message": "I love tweeting","created_at": "2017-09-13T02:49:23.459Z" }]

About

EXAMPLE: Token-based authentication RESTful API that posts a new Tweet to your Tweeter account. Controller tests included.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published