serverless-functions-api-docs

1.0.1 • Public • Published

serverless-functions-api-docs

Create the documentation of your serverless functions automatically.

🚀 Getting Started

yarn add serverless-functions-api-docs
npm install serverless-functions-api-docs

👩‍💻 Usage

Personalize your docs site

Edit the file doc_config.js with the basic information of your site or organization.

const serverlessFunct = require('serverless-functions-api-docs/index');

const config = {
    basedir: "functions",
    outputfile: "index.html",
    info: {
        sitename: "MY SITE / ORGANIZATION",
        logourl: "MY LOGO URL",
        sitedescription: "MY SITE DESCRIPTION"
    }
}

serverlessFunct.createDoc(config);

In the project

Create an index.doc.json file inside each function folder.

project
│   node_modules
│   functions
|   └───function1
|   │   │   index.js
|   │   │   index.doc.json <-
|   ...
│   package.json
│   doc_config.js    

Each file must have the following structure:

[
    {
        "name": "ENDPOINT NAME",
        "path": "/endpoint-url",
        "method": "GET",
        "description": "SOME DESCRIPTION",
        "fields": [
            {
                "name": "name",
                "type": "String",
                "required": "true"
            }
        ]
    }
]

Generate the docs

To generate the documentation we simply execute yarn run createdoc or npm run createdoc.

👏 Contributing

Pull requests and 🌟 stars are always welcome. For major changes, please open an issue first to discuss what you would like to change.

📩 Contact

rahulrcr98@gmail.com

Twitter @iamraul_net

Linkedin @iamraul

Readme

Keywords

none

Package Sidebar

Install

npm i serverless-functions-api-docs

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

9.61 kB

Total Files

9

Last publish

Collaborators

  • raulcr98