This is a tutorial made to build a RESTful JSON API With Rails with JWT authentication. It is based on this article - https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-two
- Ruby
- Rails API Only
- JWT
- JSON
To get a local copy up and running follow these simple example steps.
-
Clone this repository to your local machine using
git clone https://github.com/DanielMitiku/todos-api.git. -
Run
cd todos-apito move into the app directory. -
Run
bundle installto install all the dependencies. -
Run
rails db:migrateto migrate the database. -
Run
rails sto start the server.
-
To signup
http :3000/signup name=daniel email=daniel@daniel.com password=foobar password_confirmation=foobar. This will return authorization token. -
To create todos
http POST :3000/todos title=todo1 Authorization:'put authorization token here' -
Getting todos
http :3000/todos Authorization:'put authorization token here'.
👤 Daniel Mitiku
- Github: @danielmitiku