-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Ensure polly's middleware goes before ember-cli's #36
fix: Ensure polly's middleware goes before ember-cli's #36
Conversation
This should allow polly to work nicely with ember-cli's when the `--proxy` option is passed.
Closes #35 |
FYI this doesn't work quite as expected. The server.any().on('request', req => {
if (req.url.startsWith('/api')) {
req.url = `https://skylines.aero${req.url}`;
}
}); This solution seems to work quite well now. I'm assuming that this is/will be a common issue for people using Polly.js, so it might make sense to add it to the documentation somewhere. |
Just to clarify, this dies works as intended as long as Polly recorded the events already. |
@Turbo87 would specifying your proxy via testem solve this issue? // testem.js
{
browser_args: { /* */ },
proxies: {
'/api': {
target: 'https://skylines.aero'
}
}
} |
possibly, I wasn't aware testem could do this 🙈 |
😄 lemme know if it works and I'll add some documentation around it! |
indeed, this seems to work very well. thanks for the idea! |
I've also used that config and it's great. I didn't know that trick either. |
This should allow polly to work nicely with ember-cli's when the
--proxy
option is passed.