Skip to content

Running

lbod edited this page Sep 29, 2013 · 19 revisions

There are two ways to run this application, you'll likely want to change configuration of the application to meet your needs (which is explained in Configuration):

1) app.js

Use app.js when you want to run the API viewer over HTTP using Node.js express/jade. The application by default can be viewed in a browser at http://localhost:3000/api/

The only dependencies are the details.json and tree.json files (copied to the correctly configured folders).

Running the node.js app server API viewer:

node app.js

Viewing via app.js :

To view the root API in your browser you use the URL:

http://localhost:#{config.port}#{config.contextPath}

2) spider.js

Use spider.js when you want to generate static HTML documentation (so you can view using an HTTP server such as Apache/nginx). The files are generated into the /staticoutput directory.

Generating HTML docs for static viewing:

node spider.js

Spider.js creates the main index.html, the module html files (for each specified version) and copies all dependent resources i.e. data (tree.json/details.json), CSS, JavaScript and images to the staticoutput folder.

You can then simply copy all the contents of the staticoutput folder to any HTTP server. As long as you set the #{config.contextPath} setting correctly the whole API viewer will be ready to serve.