Created
April 2, 2014 14:27
-
-
Save abachuk/9935253 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// The actual grunt server settings | |
connect: { | |
options: { | |
port: 9000, | |
hostname: 'localhost', | |
livereload: 35729 | |
}, | |
proxies: [{ | |
context: '/api', // the context of the data service | |
host: 'mydomain.com/apis/', // wherever the data service is running | |
changeOrigin: true, | |
rewrite: { | |
// the key '^/api' is a regex for the path to be rewritten | |
// the value is the context of the data service | |
'^/api': '/smartphone' | |
} | |
}], | |
livereload: { | |
options: { | |
open: true, | |
base: [ | |
'.tmp', | |
'<%= yeoman.app %>' | |
], | |
middleware: function (connect, options) { | |
var middlewares = []; | |
if (!Array.isArray(options.base)) { | |
options.base = [options.base]; | |
} | |
// Setup the proxy | |
middlewares.push(require('grunt-connect-proxy/lib/utils').proxyRequest); | |
// Serve static files | |
options.base.forEach(function(base) { | |
middlewares.push(connect.static(base)); | |
}); | |
return middlewares; | |
} | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment