1.1.7 • Published 3 years ago

ply-movies v1.1.7

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

ply-movies

A simple, self-contained movies API for REST service testing.
The included data contains horror movies from the 1930s.

The ply-movies API is used by Ply in its automated tests and tutorials.

Install:
npm install -g ply-movies

Start:
ply-movies start

Stop:
ply-movies stop

Configuration

CLI OptionEnvironment VariableDefaultUsage
--portSERVER_PORT3000API server should listen on this port
--indentRESPONSE_INDENT0Format JSON response with this number of spaces
--fileMOVIES_FILEmovies.jsonLocation of writeable movies JSON file (created on first update)
--readonlyREADONLY_APIfalseDisallow POST, PUT, PATCH and DELETE requests
--delay0Impose a delay in milliseconds on response

Sample queries

These URLs point against ply-ct.org. However, the main point of ply-movies is to be hosted locally so that during development you can exercise all API methods, including POST, PUT, PATCH and DELETE.

All movies:

Movies made in 1931:

Movies made after 1935:

Movies sorted by rating in descending order:

Movies with a rating of 3.5 or above, sorted by year:

Find all movies with Bela Lugosi:

Retrieve the first page of movies, with page size = 25

Retrieve the second page of movies, with page size = 25

Retrieve the first page of movies from a list sorted by year

Retrieve the first page of movies featuring Boris Karloff, sorted by year

Sample POST

Create a movie by posting to /movies:

{
  "title": "The Case of the Howling Dog",
  "year": 1934,
  "credits": [
    {
      "name": "Alan Crosland",
      "role": "director"
    },
    {
      "name": "Warren William",
      "role": "actor"
    },
    {
      "name": "Mary Astor",
      "role": "actor"
    },
    {
      "name": "Allen Jenkins",
      "role": "actor"
    },
    {
      "name": "Grant Mitchell",
      "role": "actor"
    },
    {
      "name": "Helen Trenholme",
      "role": "actor"
    }
  ],
  "webRef": {
    "ref": "tt0024958",
    "site": "imdb.com"
  }
}

More examples

See Ply tests in the ply-demo repository.

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago