Open telagraphic opened 9 years ago
Where is [require('grunt-connect-proxy/lib/utils').proxyRequest];
and 'configureProxies:server',
? According to the docs, you need that:
connect: {
livereload: {
options: {
middleware: function (connect, options) {
if (!Array.isArray(options.base)) {
options.base = [options.base];
}
// Setup the proxy
var middlewares = [require('grunt-connect-proxy/lib/utils').proxyRequest];
// Serve static files.
options.base.forEach(function(base) {
middlewares.push(connect.static(base));
});
// Make directory browse-able.
var directory = options.directory || options.base[options.base.length - 1];
middlewares.push(connect.directory(directory));
return middlewares;
}
}
}
}
grunt.registerTask('server', function (target) {
grunt.task.run([
'clean:server',
'compass:server',
'configureProxies:server',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);
});
I've read a couple of SOF posts and tried the code provided in the GCP Github Page, but they do not proxy any client-side requests to my server. The task is being loaded, but chrome network shows the request does not proxy. I had this working a month ago but deleted the project and could not recover it(Hating myself for that one). Any advice on how to set up the GCP middleware for a Rails4 and AngularJS project?
Here is my Gruntfile.js and necessary project code to review: https://gist.github.com/anonymous/3894d93d83a5a0b61fd0