fortune-api

command module
v0.0.0-...-760c826 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2018 License: MIT Imports: 9 Imported by: 0

README

fortune-api

CircleCI

A HTTP API for generating fortunes, inspired by fortune.

API

GET /fortunes

Return a list of all fortunes in the fortune database.

Sample Request:

GET /fortunes

Sample Response:

Status: 200 OK

[
  {
    "id": "8843d7f",
    "data": "\"Failure is the opportunity to begin again more intelligently.\"\n  ~Henry Ford"
  }
]
GET /fortunes/:id

Return a specific fortune from the database.

Sample Request:

GET /fortunes/8843d7f

Sample Response:

Status: 200 OK

{
  "id": "8843d7f",
  "data": "\"Failure is the opportunity to begin again more intelligently.\"\n  ~Henry Ford"
}
GET /random

Return a random fortune from the database.

Sample Request:

GET /random

Sample Response:

Status: 302 Found
Location: /fortunes/8843d7f

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL