New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-explorer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-explorer

Easily create an interactive documentation for your RESTful API

  • 0.3.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

API Explorer

This module let you build a nice interactive documentation for your RESTful API only with json data. You can see the references of your resources, but you can also try to call them with examples with an easy form. So it's a documentation and an easy way to discover the API by testing it easily.

Get Started

Installation

npm install api-explorer

Add data to the explorer

var apiExplorer = require("api-explorer");
apiExplorer.createExplorer({clientPort: 8082, apiDescription: getApiDescription()});
  • clientPort: the port where the html client will be available (checkout the console to have the url)
  • apiDescription: json object containing the information of the api.
Example

The apiDescription object needs two information: apiInfo and resource. Here a simple example with one resource and one route:

function getApiDescription() {
    return {
        apiInfo: {
            "title": "The Example API",
            "description": "the description bla bla bla",
            "url": "http://localhost:8080"
        },
        resource: [{
            "name": "Example",
            "description": "This resource represents an example resource",
            "methods": [{
                "verb": "get",
                "path": "/example/{name}",
                "description": "Retrieve one example resource by name",
                "parameters": [{
                    "name": "name",
                    "description": "The name of the resource",
                    "parameterType": "id",
                    "required": true,
                    "exampleValue": "someExistingResource"
                }],
                "result": [{
                    "name": "name",
                    "description": "The name of the resource",
                    "type": "string"
                }]
            }]
        }]
    };
}

This description means that you have one resource, which the name is "Example". This resource has one route and you can access it like this: GET http://localhost:8080/example/{name}. The result will be something like {"name": "someName"}. You can find above more details the fields.

TODO screen

API Info

TODO

Resource

TODO

Keywords

FAQs

Package last updated on 24 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc