Use `dist` property from swagger-ui package.

This removes the hardcoded local `node_modules` lookup for swagger-ui,
which will break if the parent installs swagger-ui itself.

This is useful if, for example, the latest swagger-ui breaks
loopback-explorer, and the parent project wants to install a fixed
version in its root.
This commit is contained in:
Samuel Reed 2014-08-12 09:47:53 -04:00
parent 8a166083fe
commit e7efa82640
1 changed files with 1 additions and 2 deletions

View File

@ -8,8 +8,7 @@ var urlJoin = require('./lib/url-join');
var _defaults = require('lodash.defaults');
var express = require('express');
var swagger = require('./lib/swagger');
var SWAGGER_UI_ROOT = path.join(__dirname, 'node_modules',
'swagger-ui', 'dist');
var SWAGGER_UI_ROOT = require('swagger-ui').dist;
var STATIC_ROOT = path.join(__dirname, 'public');
module.exports = explorer;