Skip to content

Commit

Permalink
chore(docs,example): readme and example json clean up (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera authored Nov 19, 2021
1 parent 64776c2 commit 0c5dce0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ commit messaging follow the format
To setup your work environment you'll need to use
* [NodeJS version 12+](https://nodejs.org/)
* [Yarn 1.22+](https://yarnpkg.com)
* And if you plan on making Docker contributions you may want to setup
- [Docker](https://docs.docker.com/engine/installation/)
* And if you plan on making container contributions you may want to setup
- [Docker](https://docs.docker.com/engine/installation/) or
- [Podman](https://github.com/containers/podman), Homebrew can be used for the install `$ brew install podman`, [Easy setup directions here](https://marcusnoble.co.uk/2021-09-01-migrating-from-docker-to-podman/)

### Developing
To start work
Expand Down
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Apidoc Mock
[![Build Status](https://github.com/cdcabrera/apidoc-mock/workflows/Build/badge.svg?branch=master)](https://github.com/cdcabrera/apidoc-mock/actions?query=workflow%3ABuild)
[![codecov](https://codecov.io/gh/cdcabrera/apidoc-mock/branch/master/graph/badge.svg)](https://codecov.io/gh/cdcabrera/apidoc-mock)
[![Docker Repository on Quay](https://quay.io/repository/cdcabrera/apidoc-mock/status "Docker Repository on Quay")](https://quay.io/repository/cdcabrera/apidoc-mock)
[![License](https://img.shields.io/github/license/cdcabrera/apidoc-mock.svg)](https://github.com/cdcabrera/apidoc-mock/blob/master/LICENSE)

Tired of overthinking mock solutions, use [apidoc](http://apidocjs.com/) styled comments on your local files to create a
Expand All @@ -15,6 +16,7 @@ The basic requirements:
* Optionally your system could be running
- [Yarn 1.22+](https://yarnpkg.com), otherwise NPM should be adequate.
- [Docker](https://docs.docker.com/engine/installation/)
- [Podman](https://github.com/containers/podman), Homebrew can be used for the install `$ brew install podman`, [Easy setup directions here](https://marcusnoble.co.uk/2021-09-01-migrating-from-docker-to-podman/)


## Use
Expand Down Expand Up @@ -63,20 +65,19 @@ or Yarn

It's recommended you make sure to `.gitignore` the `.docs` directory that gets generated for `apidocs`.

### Or roll with a Docker setup
### Or roll with a container setup

Apidoc Mock can also be found on Docker Hub...
Apidoc Mock can be found on Quay.io ...

* [Docker Hub, cdcabrera/apidoc-mock](https://hub.docker.com/r/cdcabrera/apidoc-mock/)
* [Quay.io, cdcabrera/apidoc-mock](https://quay.io/repository/cdcabrera/apidoc-mock)

#### Example

The base Docker image comes preloaded with a "hello/world" example, the basics
The base Quay image comes preloaded with a "hello/world" example, the basics

```shell
$ docker pull cdcabrera/apidoc-mock
$ docker stop mock-api-test
$ docker run -i --rm -p 8000:8000 --name mock-api-test cdcabrera/apidoc-mock
$ docker run -d --rm -p 8000:8000 --name mock-api-test quay.io/cdcabrera/apidoc-mock && docker ps
```

From there you should be able to navigate to
Expand All @@ -96,7 +97,7 @@ From there you should be able to navigate to
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
*/
const getExample = () => {};
Expand All @@ -110,7 +111,7 @@ From there you should be able to navigate to
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
*/
const postExample = () => {};
Expand Down Expand Up @@ -176,21 +177,21 @@ Apidoc Mock adds in a few different custom flags to help you identify or demonst
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "lorem": "dolor",
* "ipsum": "est",
* "ipsum": "est"
* }
* @apiError {String} bad
* @apiError {String} request
* @apiErrorExample {json} Error-Response:
* HTTP/1.1 400 OK
* {
* "bad": "hello",
* "request": "world",
* "request": "world"
* }
*/
const getExample = () => {};
Expand All @@ -207,21 +208,21 @@ Apidoc Mock adds in a few different custom flags to help you identify or demonst
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "lorem": "dolor",
* "ipsum": "est",
* "ipsum": "est"
* }
* @apiError {String} bad
* @apiError {String} request
* @apiErrorExample {json} Error-Response:
* HTTP/1.1 400 OK
* {
* "bad": "hello",
* "request": "world",
* "request": "world"
* }
*/
const getExample = () => {};
Expand All @@ -238,15 +239,15 @@ Apidoc Mock adds in a few different custom flags to help you identify or demonst
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
* @apiError {String} bad
* @apiError {String} request
* @apiErrorExample {json} Error-Response:
* HTTP/1.1 400 OK
* {
* "bad": "hello",
* "request": "world",
* "request": "world"
* }
*/
const getExample = () => {};
Expand All @@ -263,15 +264,15 @@ Apidoc Mock adds in a few different custom flags to help you identify or demonst
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
* @apiError {String} bad
* @apiError {String} request
* @apiErrorExample {json} Error-Response:
* HTTP/1.1 400 OK
* {
* "bad": "hello",
* "request": "world",
* "request": "world"
* }
*/
const getExample = () => {};
Expand Down
6 changes: 3 additions & 3 deletions data/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
* HTTP/1.1 200 OK
* {
* "foo": "hello",
* "bar": "world",
* "bar": "world"
* }
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 201 OK
* {
* "lorem": "dolor",
* "ipsum": "est",
* "ipsum": "est"
* }
* @apiError {String} bad
* @apiError {String} request
* @apiErrorExample {json} Error-Response:
* HTTP/1.1 400 OK
* {
* "bad": "hello",
* "request": "world",
* "request": "world"
* }
*/
const getExample = () => {};
Expand Down

0 comments on commit 0c5dce0

Please sign in to comment.