Sign inSign up

subfuzion/vote-api

By subfuzion

•Updated almost 8 years ago

API for Docker Voting App

Image
0

1.0K

subfuzion/vote-api repository overview

⁠Vote API

The service can be started with the following environment variable overrides:

PORT: the vote service listening port (defaults to port 3000) VOTES_API_URI: the votes API backend microservice (defaults to: http://votes:3000/⁠) REPORTS_API_URI: the reports API backend microservice (defaults to: http://reports:3000/⁠)

⁠POST /vote

This endpoint is used to cast a vote.

⁠Request Body

application/json

⁠Schema
  • vote - string; currently restricted to either "a" or "b"
⁠Example
{
  "vote": "a"
}
⁠GET /results

This endpoint is used to query the voting results.

⁠Response

application/json

  • success - boolean

  • result - object; present only if success. The object has a property named for each vote ("a", "b"); the value of the property is a number corresponding to the number of votes cast.

  • reason - string; present only if success is false.

⁠Example:
{
  "success": true,
  "result": {
    "a": 5,
    "b": 3
  }
}

Tag summary

Content type

Image

Digest

Size

17.5 MB

Last updated

almost 8 years ago

docker pull subfuzion/vote-api