Add /swaggerui context in connect proxy.

This commit is contained in:
Alexis Lahouze 2016-04-15 22:22:52 +02:00
parent 88f9163dc1
commit ffc5ede6ca

View File

@ -6,6 +6,7 @@ module.exports = {
hostname: 'localhost', hostname: 'localhost',
base: '<%= accountant.frontend.src %>', base: '<%= accountant.frontend.src %>',
apiUrl: 'http://localhost:5000/api/', apiUrl: 'http://localhost:5000/api/',
swaggerUiUrl: 'http://localhost:5000/swaggerui/',
livereload: 1337, livereload: 1337,
}, },
proxies: [{ proxies: [{
@ -13,6 +14,11 @@ module.exports = {
host: '127.0.0.1', host: '127.0.0.1',
port: 5000, port: 5000,
https: false https: false
}, {
contect: '/swaggerui',
host: '127.0.0.1',
port: 5000,
https: false
}], }],
livereload: { livereload: {
options: { options: {
@ -20,11 +26,13 @@ module.exports = {
middleware: function(connect, options, middlewares) { middleware: function(connect, options, middlewares) {
var connectLogger = require('connect-logger'); var connectLogger = require('connect-logger');
var connectProxy = require('connect-proxy-layer'); var connectProxy = require('connect-proxy-layer');
var proxy = connectProxy(options.apiUrl); var apiProxy = connectProxy(options.apiUrl);
var swaggerUiProxy = connectProxy(options.swaggerUiUrl);
return [ return [
connectLogger(), connectLogger(),
connect().use('/api', proxy), connect().use('/api', apiProxy),
connect().use('/swaggerUi', swaggerUiProxy),
].concat(middlewares); ].concat(middlewares);
} }
} }