Skip to content

Instantly share code, notes, and snippets.

@trecloux

trecloux/Gruntfile.js

Last active Dec 18, 2015
Embed
What would you like to do?
Grunt proxy configuration
// Juts after var lrSnippet ....
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest;
/* ...... */
// Modify the connect task configuration : add proxies section and insert 'proxySnippet' in the middleware
connect: {
proxies: [
{
context: '/rest',
host: 'localhost',
port: 8080,
https: false,
changeOrigin: false
}
],
options: {
port: 9000,
hostname: 'localhost'
},
livereload: {
options: {
middleware: function (connect) {
return [
proxySnippet,
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
/* ...... */
// Modifify the server task to ass the configureProxies step
grunt.registerTask('server', [
'clean:server',
'coffee:dist',
'compass:server',
'configureProxies',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.