1.1.1 • Published 3 years ago

serve-api-spec v1.1.1

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

Serve API Spec

Sever API Spec allows you to pull open api spec from gitlab repository and serve the apis defined in the spec locally through prism mock server

Usage

There are five required inputs

  • API_SPEC_DOMAIN: company gitlab domain, e.g. if your company's gitlab domain is https://xyz.com, the field value here should be xyz.com
  • API_SPEC_PROJECT: Project id of the project that you keep open api yaml
  • API_SPEC_TOKEN: Project access token of the project that you keep openapi yaml
  • API_SPEC_BRANCH: The branch that contains the openapi yaml file.
  • API_SPEC_PATH: File path relative to project root.

You can define these inputs in you .bashrc or .zshrc. You can also pass cli params. If both exist, cli params will take precedence.

To run the package, you can simply do:

npx serve-api-spec --API_SPEC_DOMAIN 'xyz.com' --API_SPEC_PROJECT '123' --API_SPEC_TOKEN 'abcd' --API_SPEC_BRANCH 'master' --API_SPEC_PATH 'file/path'

Or, you can install first:

npm i serve-api-spec@latest

And then:

npx serve-api-spec --API_SPEC_DOMAIN 'xyz.com' --API_SPEC_PROJECT '123' --API_SPEC_TOKEN 'abcd' --API_SPEC_BRANCH 'master' --API_SPEC_PATH 'file/path'
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago