-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Explicit proxies #1530
[WIP] Explicit proxies #1530
Conversation
Definitely 👍 on the idea, ping when its ready for detailed review... |
@@ -9,7 +9,7 @@ | |||
|
|||
var bodyParser = require('body-parser'); | |||
var globSync = require('glob').sync; | |||
var routes = globSync('./routes/**/*.js', { cwd: __dirname }).map(require); | |||
var routes = globSync('./*/**/*.js', { cwd: __dirname }).map(require); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the first /*
can be dropped /**/*.js
should be sufficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EndangeredMassa said that accidentally tried to load server/index.js
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes it would.
any ideas if proxy should occur before or after other middle ware and if so how would one accomplish this |
@trek let me know if I'm blocking you on this one |
@stefanpenner I can see problems with both proxy orderings: before and after. Should we just pick one and let it fly? I'd think letting new middleware break apps would be worse than letting proxies break middleware but both seem bad. Do you have an example of what the middleware do? we've never used one. |
@trek can we make proxies just happen last? I suspect if someone overrides a route explicitly they understand and expect that functionality |
roger roger. |
@trek once you feel good about this, if you can add an integration test (so we can ensure the generator keeps generating something that actually proxies) that would be awesome. Other then that i think this is good, once you think its good give it a good change-log entry and pull the switch. |
not a huge fan of |
@jgwhite thoughts? |
@stefanpenner @trek long-term, taking Thor as inspiration, my feeling is that blueprints should have a set of utility functions along the lines of:
|
test failures seem to be install/build based? |
@trek AppVeyor builds are broken for now |
it looks like travis is also broken for the PR: https://travis-ci.org/stefanpenner/ember-cli/pull_requests |
Conflicts: tests/acceptance/generate-test.js
Conflicts: CHANGELOG.md
Green travis-ci build, at least. https://travis-ci.org/stefanpenner/ember-cli/builds/31859850 |
Just a WIP for having more complex proxy behavior.
Proposed changes:
api-stub
generator tohttp-mock
, which is maybe more accurate? :bikeshed:http-proxy
with example proxy:ember g proxy api 127.0.0.1:8000
server
directory to includemocks
andproxies
Nice to have
--proxy
behavior, but warn if used when explicit proxies are generated