ruby on rails - Gulp proxy-middleware : how to set? -
i'm trying bridge between frontend app , backend app , gulp documentation quite poor it. installed proxy-middleware.
the structure of project :
| myproject | backend app/ | backend config/ | backend folders/ .... | front/ | app/ | dist/ gulpfile.js | other frontend folders/ here ...
this looks quite common.
so in gulpfile have :
var proxy = require('proxy-middleware'); ... gulp.task('connect', ['styles', 'fonts'], function () { var servestatic = require('serve-static'); var serveindex = require('serve-index'); var app = require('connect')() .use(require('connect-livereload')({port: 35729})) .use(servestatic('.tmp')) .use(servestatic('app')) .use('/bower_components', servestatic('bower_components')) .use(serveindex('app')) .use('/', proxy(url.parse('http://localhost:3000'))); require('http').createserver(app) .listen(9000) .on('listening', function () { console.log('started connect web server on http://localhost:9000'); }); }); gulp.task('serve', ['rails', 'connect', 'watch'], function () { require('opn')('http://localhost:9000'); });
i know seems weird ( / redirects localhost:3000 ) , generates 500 of assets (css , js)
has dig , found solution or doc/tuto ?
Comments
Post a Comment