defapi-client
v0.1.0
Published
Client server for viewing defapi api definitions
Downloads
4
Readme
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
- Clone the repo
- Run:
$ defapi-client init
. This creates adefapi.sources.js
file (seesample-defapi.sources.js
for sample contents). - Edit the
defapi.sources.js
file for each of your api sources that you want to be captured bydefapi-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). - Make other desired changes to the project (names, docker setups, other configuration).
- Host your
defapi-client
project.
Change Logs
0.1.0-beta
$ defapi-client init
command to create the sources file.defapi.sources.js
- SpecifybaseUri
of the source instead ofmanifestUrl
.manifestUrl
is now discarded fromdefapi.sources.js
.$ defapi-client serve
- Allow user to specify preferred port by passing--port
option.- Client: Link to refresh api manifest