{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3579","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3579/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3579/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3579/events","html_url":"https://github.com/ember-cli/ember-cli/pull/3579","id":63253498,"number":3579,"title":"allow for ./server to export express app","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-03-20T15:54:42Z","updated_at":"2015-03-23T17:18:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/3579","html_url":"https://github.com/ember-cli/ember-cli/pull/3579","diff_url":"https://github.com/ember-cli/ember-cli/pull/3579.diff","patch_url":"https://github.com/ember-cli/ember-cli/pull/3579.patch"},"body":"the whole app factory pattern is a bit foreign for express apps as there is a build in mechanism for adding routes from one express app to another, that is the `.use` method.  A common pattern is for the server function to export an app that can then be passed as middleware to somewhere else or get used with http[s].createServer, so this pull adds compatablity for having a server/index that does something like \r\n\r\n```js\r\nvar app = module.exports = require('express')();\r\n```\r\n\r\nby checking if the function exported by the server module has a length of 3, i.e. is of the form\r\n\r\n```js\r\nvar app = function(req, res, next) {\r\n  app.handle(req, res, next);\r\n};\r\n```\r\n\r\nwhich is what an express app is"},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/85104020","html_url":"https://github.com/ember-cli/ember-cli/pull/3579#issuecomment-85104020","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3579","id":85104020,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T17:18:18Z","updated_at":"2015-03-23T17:18:18Z","body":"windows CI issues appear unrelated..."}}