{"action":"created","issue":{"url":"https://api.github.com/repos/fedwiki/wiki-server/issues/115","labels_url":"https://api.github.com/repos/fedwiki/wiki-server/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/fedwiki/wiki-server/issues/115/comments","events_url":"https://api.github.com/repos/fedwiki/wiki-server/issues/115/events","html_url":"https://github.com/fedwiki/wiki-server/pull/115","id":127151549,"number":115,"title":"pass app to plugins to add routes","user":{"login":"WardCunningham","id":12127,"avatar_url":"https://avatars.githubusercontent.com/u/12127?v=3","gravatar_id":"","url":"https://api.github.com/users/WardCunningham","html_url":"https://github.com/WardCunningham","followers_url":"https://api.github.com/users/WardCunningham/followers","following_url":"https://api.github.com/users/WardCunningham/following{/other_user}","gists_url":"https://api.github.com/users/WardCunningham/gists{/gist_id}","starred_url":"https://api.github.com/users/WardCunningham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WardCunningham/subscriptions","organizations_url":"https://api.github.com/users/WardCunningham/orgs","repos_url":"https://api.github.com/users/WardCunningham/repos","events_url":"https://api.github.com/users/WardCunningham/events{/privacy}","received_events_url":"https://api.github.com/users/WardCunningham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-18T04:30:14Z","updated_at":"2016-01-19T16:00:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fedwiki/wiki-server/pulls/115","html_url":"https://github.com/fedwiki/wiki-server/pull/115","diff_url":"https://github.com/fedwiki/wiki-server/pull/115.diff","patch_url":"https://github.com/fedwiki/wiki-server/pull/115.patch"},"body":"Caution: I've yet to successfully build this module.\r\n\r\nThis pull request adds app to the parameters passed to a server-side plugin. This allows the plugin to add routes for restful service to the client-side plugin. Until now we have used websockets for this communication.\r\n\r\nThe Shell plugin provides an example of this in use. [github](https://github.com/WardCunningham/wiki-plugin-shell/blob/master/server/server.coffee)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/12127/12383172/b4807c66-bd57-11e5-95e8-a1971365cb44.png)\r\n\r\nAs mentioned above, I'm having trouble building this module such that it can be npm-linked into a current install of wiki. I've successfully hand patched this functionality into wiki's installed version but a build from source gives this error on startup. I'll need some help diagnosing this.\r\n```\r\nnode index.js -p 3020\r\n\r\n Error: Cannot find module 'wiki-security-persona'\r\n  at Function.Module._resolveFilename (module.js:336:15)\r\n  at Function.Module._load (module.js:286:25)\r\n  at Module.require (module.js:365:17)\r\n  at require (module.js:384:17)\r\n  at module.exports.exports (/Users/ward/FedWiki/wiki-server/lib/server.js:133:43)\r\n  at Object.<anonymous> (/Users/ward/FedWiki/wiki/cli.coffee:133:9)\r\n  at Object.<anonymous> (/Users/ward/FedWiki/wiki/cli.coffee:1:1)\r\n```"},"comment":{"url":"https://api.github.com/repos/fedwiki/wiki-server/issues/comments/172898883","html_url":"https://github.com/fedwiki/wiki-server/pull/115#issuecomment-172898883","issue_url":"https://api.github.com/repos/fedwiki/wiki-server/issues/115","id":172898883,"user":{"login":"WardCunningham","id":12127,"avatar_url":"https://avatars.githubusercontent.com/u/12127?v=3","gravatar_id":"","url":"https://api.github.com/users/WardCunningham","html_url":"https://github.com/WardCunningham","followers_url":"https://api.github.com/users/WardCunningham/followers","following_url":"https://api.github.com/users/WardCunningham/following{/other_user}","gists_url":"https://api.github.com/users/WardCunningham/gists{/gist_id}","starred_url":"https://api.github.com/users/WardCunningham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WardCunningham/subscriptions","organizations_url":"https://api.github.com/users/WardCunningham/orgs","repos_url":"https://api.github.com/users/WardCunningham/repos","events_url":"https://api.github.com/users/WardCunningham/events{/privacy}","received_events_url":"https://api.github.com/users/WardCunningham/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T16:00:56Z","updated_at":"2016-01-19T16:00:56Z","body":"@paul90, this is probably the advice I needed to protect the Shell plugin. I was experimenting with securityHandler trying to duplicate logic in wiki-server. I will follow one or more of these paths and improve this PR.\r\n\r\nI'm still stuck getting wiki-security-plugin to load. Any tips for debugging? I'll just insert console.logs unless you can suggest better technique."}}