Remove direct dependency on express
This commit is contained in:
parent
530808312a
commit
a900a721ba
10
index.js
10
index.js
|
@ -6,7 +6,7 @@ var url = require('url');
|
|||
var path = require('path');
|
||||
var urlJoin = require('./lib/url-join');
|
||||
var _defaults = require('lodash.defaults');
|
||||
var express = require('express');
|
||||
var loopback = require('loopback');
|
||||
var swagger = require('./lib/swagger');
|
||||
var SWAGGER_UI_ROOT = require('swagger-ui').dist;
|
||||
var STATIC_ROOT = path.join(__dirname, 'public');
|
||||
|
@ -26,7 +26,7 @@ function explorer(loopbackApplication, options) {
|
|||
apiInfo: loopbackApplication.get('apiInfo') || {}
|
||||
});
|
||||
|
||||
var app = express();
|
||||
var app = loopback();
|
||||
|
||||
swagger(loopbackApplication, app, options);
|
||||
|
||||
|
@ -52,12 +52,12 @@ function explorer(loopbackApplication, options) {
|
|||
// In this way one could e.g. make changes to index.html without having
|
||||
// to worry about constantly pulling in JS updates.
|
||||
if (options.swaggerDistRoot) {
|
||||
app.use(express.static(options.swaggerDistRoot));
|
||||
app.use(loopback.static(options.swaggerDistRoot));
|
||||
}
|
||||
// File in node_modules are overridden by a few customizations
|
||||
app.use(express.static(STATIC_ROOT));
|
||||
app.use(loopback.static(STATIC_ROOT));
|
||||
// Swagger UI distribution
|
||||
app.use(express.static(SWAGGER_UI_ROOT));
|
||||
app.use(loopback.static(SWAGGER_UI_ROOT));
|
||||
|
||||
return app;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"dependencies": {
|
||||
"cors": "^2.4.2",
|
||||
"debug": "~1.0.3",
|
||||
"express": "3.x",
|
||||
"express": "4.x",
|
||||
"lodash.assign": "^2.4.1",
|
||||
"lodash.clonedeep": "^2.4.1",
|
||||
"lodash.defaults": "^2.4.1",
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
var url = require('url');
|
||||
var urlJoin = require('../lib/url-join');
|
||||
var loopback = require('loopback');
|
||||
var express = require('express');
|
||||
var swagger = require('../lib/swagger');
|
||||
|
||||
var request = require('supertest');
|
||||
|
|
Loading…
Reference in New Issue