Skip to content

Instantly share code, notes, and snippets.

@TomTasche
Created December 27, 2015 22:35
Show Gist options
  • Save TomTasche/6c3ff778fe5552d9a184 to your computer and use it in GitHub Desktop.
Save TomTasche/6c3ff778fe5552d9a184 to your computer and use it in GitHub Desktop.
dispatcher for multi-module appengine setups
// ...
var proxySnippet = require("grunt-connect-proxy/lib/utils").proxyRequest;
gruntConfig.connect = {
server: {
options: {
port: 9000,
hostname: "0.0.0.0",
keepalive: true,
middleware: function(connect, options) {
return [proxySnippet];
}
},
proxies: [{
context: "/api",
host: "localhost",
port: 8081
}, {
context: "/",
host: "localhost",
port: 8080
}]
}
};
grunt.initConfig(gruntConfig);
grunt.registerTask("dispatch", ["configureProxies:server", "connect"]);
// ...
{
// ...
"dependencies": {
"grunt-connect-proxy": "~0.2.0",
"grunt-contrib-connect": "~0.11.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment