{"action":"opened","issue":{"url":"https://api.github.com/repos/dancingrobot84/purescript-express/issues/12","labels_url":"https://api.github.com/repos/dancingrobot84/purescript-express/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/dancingrobot84/purescript-express/issues/12/comments","events_url":"https://api.github.com/repos/dancingrobot84/purescript-express/issues/12/events","html_url":"https://github.com/dancingrobot84/purescript-express/issues/12","id":59171151,"number":12,"title":"Add `embedded` for embedding purescript-express `App` in an existing `Application`","user":{"login":"dvdsgl","id":108197,"avatar_url":"https://avatars.githubusercontent.com/u/108197?v=3","gravatar_id":"","url":"https://api.github.com/users/dvdsgl","html_url":"https://github.com/dvdsgl","followers_url":"https://api.github.com/users/dvdsgl/followers","following_url":"https://api.github.com/users/dvdsgl/following{/other_user}","gists_url":"https://api.github.com/users/dvdsgl/gists{/gist_id}","starred_url":"https://api.github.com/users/dvdsgl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvdsgl/subscriptions","organizations_url":"https://api.github.com/users/dvdsgl/orgs","repos_url":"https://api.github.com/users/dvdsgl/repos","events_url":"https://api.github.com/users/dvdsgl/events{/privacy}","received_events_url":"https://api.github.com/users/dvdsgl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-27T00:55:41Z","updated_at":"2015-02-27T00:55:41Z","closed_at":null,"body":"I have a large express app written in JavaScript, and I'd like to start writing new handlers in purescript. I'd like to be able to do this:\r\n\r\nIn `Main.purs`:\r\n\r\n```purescript\r\nmodule Main (initialize) where\r\n\r\napp :: App\r\napp = get \"/ps\" $ send \"Hello, PureScript!\"\r\n\r\ninitialize :: Fn1 Application Unit\r\ninitialize = Node.Express.App.embedded app\r\n```\r\n\r\nIn `server.js`:\r\n\r\n```javascript\r\nvar Main = require(\"Main\");\r\nvar app = require(\"express\")();\r\n\r\napp.get(\"/js\", function(req, res) { res.send(\"Hello, JavaScript!\"); });\r\nMain.initialize(app);\r\napp.listen(8080);\r\n```\r\n\r\nI'm not sure if there's a better semantics for this, but it would really help existing express apps implement new functionality in purescript, and eventually port entirely, which is my goal."}}