Coder Social home page Coder Social logo

jstoiko / api-notebook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvdnkpr/api-notebook

0.0 1.0 0.0 7.62 MB

Interactive API notebook

License: Other

JavaScript 89.99% Makefile 0.17% Shell 0.64% Smarty 0.22% Python 0.11% HTML 2.61% CSS 6.26%

api-notebook's Introduction

API Notebook

Build Status

Interactive API notebook - demo.

Development

# Install dependencies
npm install
npm install -g grunt-cli

# Start development server
grunt
# open http://localhost:3000

# Run tests in the browser (requires the server to be running)
open test/index.html

# Run headless tests
grunt test

Remember to add a new config file (E.g. config/development.json) to get up and running. For example, here is my development config (with secret keys omitted, you'll have to find your own set).

{
  "application": {
    "url": "http://localhost:3000"
  },
  "plugins": {
    "ramlClient": {
      "oauth1": {
        "https://api.twitter.com/oauth/authorize": {
          "consumerKey": "...",
          "consumerSecret": "..."
        }
      },
      "oauth2": {
        "https://github.com/login/oauth/authorize": {
          "scopes": ["user", "public_repo", "repo:status", "notifications", "gist"],
          "clientId": "...",
          "clientSecret": "..."
        },
        "https://www.box.com/api/oauth2/authorize": {
          "clientId": "...",
          "clientSecret": "...",
          "redirectUri": "https://api-notebook.anypoint.mulesoft.com/authenticate/oauth.html"
        }
      }
    },
    "proxy": {
      "url": "/proxy"
    },
    "github": {
      "clientId": "...",
      "clientSecret": "..."
    }
  }
}

Sources

The project is split with multiple HTML files acting as entry points to fulfil the embedded requirement of the API Notebook. For example, src/index.html is the most feature complete page featuring all the available plugins and rendering in "page" mode, while src/embedded.html is an example of the notebook running in "embedded" mode. Finally, src/embed.html should never be opened directly but it is the rendered notebook that usually resides inside the <iframe> instance.

Configuration

Project configuration is through node-config. To add or override config options, just add a file for your environment (E.g. development.json). All plugin config options should be stored under the plugins key, while other options are depicted in the example.json and default.json files.

To use the GitHub plugin functionality, register a new application on Github and set your keys in under plugins.github. Make sure that your new application has the application.url as Authorization callback URL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.