Skip to content
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

Ensure that things loaded by server/index.js override addons. #2008

Merged
merged 1 commit into from
Sep 16, 2014

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 16, 2014

Express will always process the first matching middleware.

A couple examples where this is bad:

  • If a proxy was setup, it is always hit before any http-mocks you have setup (since it is itself an addon).
  • If you want to serve static content (or another express middleware) from server/index.js you could never handle requests with an accept header including HTML. If you did, it would have hit the history state addon and just served up app/index.html.

In general, it is our policy that the application will always "trump" addon code.

Closes #1997.

Express will always process the first matching middleware.

A couple examples where this is bad:

* If a proxy was setup, it is always hit before any http-mocks
  you have setup (since it is itself an addon).
* If you want to serve static content (or another express middleware)
  from `server/index.js` you could never handle requests with an accept
  header including HTML. If you did, it would have hit the history state
  addon and just served up `app/index.html`.

In general, it is our policy that the application will always "trump"
addon code.
rwjblue added a commit that referenced this pull request Sep 16, 2014
Ensure that things loaded by server/index.js override addons.
@rwjblue rwjblue merged commit 431aad3 into ember-cli:master Sep 16, 2014
@rwjblue rwjblue deleted the app-wins-express branch September 16, 2014 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants