Giter VIP home page Giter VIP logo

todo-list-api's Introduction

todo-list-api

getting started

$ docker-compose up --build
# access to localhost:3000

認証

devise-token-auth を利用しています

新規登録

POST /v1/users/auth/

Request
{
  "email":"[email protected]",
  "password":"password",
  "password_confirmation": "password"
}

Response
{
   "status":"success",
   "data":{
      "uid":"[email protected]",
      "id":1,
      "email":"[email protected]",
      "provider":"email",
      "allow_password_change":false,
      "name":null,
      "nickname":null,
      "image":null,
      "created_at":"2020-04-16T02:58:40.765Z",
      "updated_at":"2020-04-16T02:58:40.889Z"
   }
}

サインイン

POST /v1/users/auth/sign_in

Request
{
  "email":"[email protected]",
  "password":"password"
}

ResponseHeader
"access-token": "G1Fcytw8FkhlYhMWRypBjA"
"token-type": "Bearer"
"client": "CIX_z6sBzKghvoh4ZhiV5A"
"expiry": "1588234471"
"uid": "[email protected]"

ResponseBody
{
  "data": {
    "id": 1,
    "email": "[email protected]",
    "provider": "email",
    "uid": "[email protected]",
    "allow_password_change": false,
    "name": null,
    "nickname": null,
    "image": null
  }
}

レスポンスヘッダにあるaccess-token, token-type, client, uidを各エンドポイントのリクエストヘッダに追加することで認証できる。

認証の確認

適当なエンドポイントを叩く

GET /v1/todos

RequestHeader
"access-token": "G1Fcytw8FkhlYhMWRypBjA"
"client": "CIX_z6sBzKghvoh4ZhiV5A"
"uid": "[email protected]"

ResponseBody
[]

todo-list-api's People

Contributors

mh4gf avatar rh-taro avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.