gulp-api-proxy
v1.0.0
Published
a api proxy module for gulp-connect
Downloads
4
Readme
gulp-api-proxy
A simple proxy middleware for gulp-connect derived from gulp-connect-proxy
How to use
var Proxy = require('gulp-api-proxy');
gulp.task('connect', function () {
connect.server({
root: 'dist/',
port: 9000,
livereload: true,
middleware: function (connect, opt) {
// `localhost/server/api/getuser/1` will be proxied to `192.168.1.186/server/api/getuser/1`
opt.route = '/server';
opt.context = '192.168.1.186/server';
var proxy = new Proxy(opt);
return [proxy];
}
});
});
Notes:
derived from gulp-connect-proxy
, Thank the original author