/bg-pnd

Primary LanguageJavaScript

demo project

Notes

Prerequisites

Run

  • grunt build for building production code (into /dist)
  • grunt serve for locally running code (http://localhost:9000)
  • grunt serve:dist for locally running production code

GitHub API

used the following API resources

GET /api/status.json for systen status

GET /api/messages.json for seeing all recent messages

REST API

base url : /api/v1/

GET /api/v1/github/

general request, will result in fixed status:

HTTP 200 OK

  {
    message: 'active',
    statusCode: 1
  }
POST /api/v1/github/current

create a new request for github status; response is:

HTTP 202 ACCEPTED

Location: /current/1445092065925

where location header has unix epoch milliseconds timestamp, as id for querying created resource response.

GET /api/v1/github/current/{id}

query github current status request, where {id} is the epoch milliseconds timestamp, returned in location header.

possible responses are:

HTTP 200 OK

if status request is done (based on its id) or a newer status request is done. a body example:

{
  "content": {
    "status": {
      "display": "Current status",
      "values": [
        "good"
      ]
    },
    "availability": {
      "display": "Availability",
      "values": []
    }
  }
}
HTTP 204 NO CONTENT

if status request is not done yet and no newer status request is done.

HTTP 410 GONE

if status request was made over 1 minute ago. User must create a new request.

{
  "msg": {
    "request is out-of-date and permanently unavailable, please re-issue an new status request"
  }
}