accountant-ui/grunt-config/connect.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

'use strict';
module.exports = {
options: {
2016-10-09 20:33:59 +02:00
port: 5001,
hostname: 'localhost',
base: '<%= accountant.frontend.src %>',
apiUrl: 'http://localhost:5000/api/',
swaggerUiUrl: 'http://localhost:5000/swaggerui/',
livereload: 1337
},
proxies: [{
2016-10-09 20:33:59 +02:00
context: '/api',
host: '127.0.0.1',
port: 5000,
https: false
}, {
2016-10-09 20:33:59 +02:00
contect: '/swaggerui',
host: '127.0.0.1',
port: 5000,
https: false
}],
livereload: {
2016-10-09 20:33:59 +02:00
options: {
//open: true,
middleware: function(connect, options, middlewares) {
var connectLogger = require('connect-logger');
var connectProxy = require('connect-proxy-layer');
var apiProxy = connectProxy(options.apiUrl);
var swaggerUiProxy = connectProxy(options.swaggerUiUrl);
2016-10-09 20:33:59 +02:00
return [
connectLogger(),
connect().use('/api', apiProxy),
connect().use('/swaggerUi', swaggerUiProxy)
].concat(middlewares);
}
}
}
};