Last active
August 29, 2015 14:10
-
-
Save kdimatteo/2bc0aa0906c326770b0d to your computer and use it in GitHub Desktop.
ember-cli http-mock proxy
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
// file: /server/proxies/products.js | |
// instead of a mock, i always want to hit the API for this endpoint... | |
module.exports = function(app) { | |
var url = require('url'); | |
var proxy = require('proxy-middleware'); | |
app.post("/api/products/*", proxy(url.parse('http://foo.bar.com/api/products'))); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment