Last active
December 18, 2015 08:39
-
-
Save trecloux/5756278 to your computer and use it in GitHub Desktop.
Grunt proxy configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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