api-playground/README.md
2023-09-07 20:04:23 -04:00

968 B

API Playground

This is a mock API playground used for developing robust API wrappers and other HTTP-related code.

Requirements

Requires either Mockoon Desktop or Mockoon CLI

Features

  • JSON responses
  • Randomized HTTP responses

Usage

docker compose up

Requests will be served at http://localhost:3000 unless another port is specified in the compose file.

Routes

/users

The /users endpoint will return a JSON list of 50 users:

[ { "id": "string", "username": "string" } ]

Randomly returns HTTP 500 and 502 status codes.

/admin/users

The /admin/users endpoint will return a JSON list of 50 users:

[ { "id": "string", "username": "string", "isAdmin": "boolean" } ]

Route will always return '401 - Unauthorized" unless an Authorization header is sent with the following token:

  • Bearer e3797209-119e-4671-8792-3c9e29260b28