Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

iocodz/serverless-functions-api-docs

Repository files navigation

serverless-functions-api-docs

npm version npm downloads

Create the documentation of your serverless functions automatically.

  • Netlify Functions
  • Vercel Functions

πŸš€ 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.

For Next and Nuxt it is recommended to set the outputfile path to public and static folders.

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.

Final Result

Look at the web generated in https://raulcr98.github.io/serverless-functions-api-docs/

image

πŸ‘ 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

About

πŸš€ Create the documentation of your serverless api "automatically".

Topics

Resources

Contributing

Stars

Watchers

Forks

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /