Skip to content

Instantly share code, notes, and snippets.

@kdimatteo
Last active August 29, 2015 14:10
Show Gist options
  • Save kdimatteo/2bc0aa0906c326770b0d to your computer and use it in GitHub Desktop.
Save kdimatteo/2bc0aa0906c326770b0d to your computer and use it in GitHub Desktop.
ember-cli http-mock proxy
// 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