Having trouble configuring angular and grunt-proxy-connect.
My static files are served but the web server of the proxy is never hit.
Here is the section of gruntfile.js that I am working in.
The actual grunt server settings
connect: {
options: {
port: 9000,
hostname: 'localhost',
livereload: 35729
},
proxies: [{
context: '/', // the context of the data service
host: 'localhost/', // wherever the data service is running
changeOrigin: true,
port:3000
}],
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= yeoman.app %>'
],
middleware: function (connect, options) {
return [
require('grunt-connect-proxy/lib/utils').proxyRequest,
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect.static(appConfig.app)
];
}
}
},
Perhaps you missed that part?
https://github.com/drewzboto/grunt-connect-proxy#adding-the-configureproxy-task-to-the-server-task
In short, find this section in your Gruntfile (I assume it is generated by yeoman angular generator)
grunt.task.run([
'clean:server',
'wiredep',
'concurrent:server',
'autoprefixer',
'configureProxies:server', // ... and add this line
'connect:livereload',
'watch'
]);
I would also reset the proxies section to defaults:
proxies: [{
context: '/api',
host: 'localhost', // get rid of the '/'
changeOrigin: false,
port:3000 // hello, fellow Rails developer :)
}],