0.1.0 • Published 3 years ago

defapi-client v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

defapi-client

Client server for viewing defapi api definitions.

Prerequisites

defapi

Core library for defining your api endpoints to be viewed by defapi-client. Install defapi in your api project. See the README for usage info.

$ npm install defapi

CLI

You can use the defapi-client cli during local development to view the api definitions of your service project.

Install

$ npm install defapi-client

Usage

$ defapi-client serve

# Options
# --baseUri - The base uri of your service.
# --port - The preferred port on which to serve your api definitions

Self Hosted Usage

  1. Clone the repo
  2. Run: $ defapi-client init. This creates a defapi.sources.js file (see sample-defapi.sources.js for sample contents).
  3. Edit the defapi.sources.js file for each of your api sources that you want to be captured by defapi-client. You might consider using environment variables to determine what urls will be configured for each source based on the target environment (e.g. development, staging or production).
  4. Make other desired changes to the project (names, docker setups, other configuration).
  5. Host your defapi-client project.

Change Logs

0.1.0-beta

  • $ defapi-client init command to create the sources file.
  • defapi.sources.js - Specify baseUri of the source instead of manifestUrl. manifestUrl is now discarded from defapi.sources.js.
  • $ defapi-client serve - Allow user to specify preferred port by passing --port option.
  • Client: Link to refresh api manifest