Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into backend
Browse files Browse the repository at this point in the history
  • Loading branch information
b1f6c1c4 committed Dec 30, 2017
2 parents eec09e9 + d36c536 commit f854cd9
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 1 deletion.
113 changes: 113 additions & 0 deletions docs/api.apib
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
FORMAT: 1A
HOST: https://b1f6c1c4-try-react.herokuapp.com/api

# Try React
A react boilerplate

# Group Default

## Check system status [GET /]
+ Response 200 (application/json; charset=utf-8)

+ Body

{
"version": "4907ca16",
"commitHash": "4907ca16faf693b76a71df0efd19ef9dcefaa309"
}

+ Schema

{
"type": "object",
"properties": {
"version": {
"type": "string"
},
"commitHash": {
"type": "string"
}
}
}

# Group User

## Get credential [POST /login]
+ Request (application/json)

+ Body

{
"username": "admin",
"password": "123456"
}

+ Schema

{
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"username",
"password"
]
}

+ Response 200 (application/json; charset=utf-8)

+ Body

{
"message": "ok",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNTEzOTMzNzQyLCJhdWQiOiJ0cnktcmVhY3QiLCJpc3MiOiJ0cnktcmVhY3QifQ.cp9bmi_jdVsetN4WcHYKdgOEtaMCZcHKDMy2_jTtkik"
}

+ Schema

{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"token": {
"type": "string"
}
}
}

+ Response 401

## Get user profile [GET /profile]
+ Request
+ Headers

Authorization: Bearer JWT

+ Response 200 (application/json; charset=utf-8)

+ Body

{
"username": "admin"
}

+ Schema

{
"type": "object",
"properties": {
"username": {
"type": "string"
}
}
}

+ Response 401
2 changes: 1 addition & 1 deletion dredd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ hooks-worker-term-retry: 500
hooks-worker-handler-host: 127.0.0.1
hooks-worker-handler-port: 61321
config: ./dredd.yml
blueprint: ../master/docs/api.apib
blueprint: docs/api.apib
endpoint: 'http://localhost:3000/api'

0 comments on commit f854cd9

Please sign in to comment.