Load swagger ui from `swagger-ui` package instead.
Added option `swaggerDistRoot` for specific file overrides. Conflicts: README.md example/simple.js index.js package.json public/css/screen.css public/images/logo_small.png public/index.html public/lib/loadSwaggerUI.js
This commit is contained in:
parent
28d293b6f9
commit
86d79584f9
13
README.md
13
README.md
|
@ -96,3 +96,16 @@ Options are passed to `explorer(app, options)`.
|
|||
> Default: Read from package.json
|
||||
|
||||
> Sets your API version. If not present, will read from your app's package.json.
|
||||
=======
|
||||
> Set the base path for swagger resources.
|
||||
> Default: `app.get('restAPIRoot')` or `/swagger/resources`.
|
||||
|
||||
`swaggerDistRoot`: **String**
|
||||
|
||||
> Set a path within your application for overriding Swagger UI files.
|
||||
|
||||
> If present, will search `swaggerDistRoot` first when attempting to load Swagger UI, allowing
|
||||
you to pick and choose overrides.
|
||||
|
||||
> See [index.html](public/index.html), where you may want to begin your overrides.
|
||||
> The rest of the UI is provided by [Swagger UI](https://github.com/wordnik/swagger-ui).
|
||||
|
|
6
index.js
6
index.js
|
@ -1,4 +1,4 @@
|
|||
'use strict';
|
||||
'use strict';
|
||||
/*!
|
||||
* Adds dynamically-updated docs as /explorer
|
||||
*/
|
||||
|
@ -8,7 +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',
|
||||
var SWAGGER_UI_ROOT = path.join(__dirname, 'node_modules',
|
||||
'swagger-ui', 'dist');
|
||||
var STATIC_ROOT = path.join(__dirname, 'public');
|
||||
|
||||
|
@ -61,4 +61,4 @@ function explorer(loopbackApplication, options) {
|
|||
app.use(express.static(SWAGGER_UI_ROOT));
|
||||
|
||||
return app;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 770 B |
Binary file not shown.
Before Width: | Height: | Size: 9.0 KiB |
|
@ -4,8 +4,8 @@
|
|||
/*global SwaggerUi, log, ApiKeyAuthorization, hljs, window, $ */
|
||||
$(function() {
|
||||
$.getJSON('config.json', function(config) {
|
||||
log(config);
|
||||
loadSwaggerUi(config);
|
||||
log(config);
|
||||
loadSwaggerUi(config);
|
||||
});
|
||||
|
||||
var accessToken;
|
||||
|
|
Loading…
Reference in New Issue