{"action":"opened","issue":{"url":"https://api.github.com/repos/adamhalasz/diet/issues/37","repository_url":"https://api.github.com/repos/adamhalasz/diet","labels_url":"https://api.github.com/repos/adamhalasz/diet/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/adamhalasz/diet/issues/37/comments","events_url":"https://api.github.com/repos/adamhalasz/diet/issues/37/events","html_url":"https://github.com/adamhalasz/diet/issues/37","id":146925145,"number":37,"title":"Support for mounting diet as middleware layer.","user":{"login":"frank-dspeed","id":7239575,"avatar_url":"https://avatars.githubusercontent.com/u/7239575?v=3","gravatar_id":"","url":"https://api.github.com/users/frank-dspeed","html_url":"https://github.com/frank-dspeed","followers_url":"https://api.github.com/users/frank-dspeed/followers","following_url":"https://api.github.com/users/frank-dspeed/following{/other_user}","gists_url":"https://api.github.com/users/frank-dspeed/gists{/gist_id}","starred_url":"https://api.github.com/users/frank-dspeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frank-dspeed/subscriptions","organizations_url":"https://api.github.com/users/frank-dspeed/orgs","repos_url":"https://api.github.com/users/frank-dspeed/repos","events_url":"https://api.github.com/users/frank-dspeed/events{/privacy}","received_events_url":"https://api.github.com/users/frank-dspeed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-08T13:09:09Z","updated_at":"2016-04-08T13:09:09Z","closed_at":null,"body":"This will Add cross compatiblity to diet.js\r\n\r\nAllow: use in express diet.js middelware.\r\nAllow: use httpCreate server with diet.js\r\nAllow: use of express middelware in dietjs without converting via converting signal to req, res and vice versa with perserving Options!\r\n\r\n\r\nbuild and return a function called diet.mount(req, res, next)\r\nThis will allow mounting dietjs as a middleware routing layer of express, connect, httpServer\r\n\r\nWe will offer a extra mount point that can be used in express, connect, httpServer.create()\r\n\r\nthat takes req, res, next only forms signal \r\n\r\nthis will allow:\r\napp = require('express')\r\ndiet = require('diet')\r\n\r\ndiet.get('/', function($){\r\n    console.log('1st route', '1st middleware')\r\n    $.end('hello world!', true); // <-- stop middleware chain\r\n}, function(){\r\n    console.log('1st route', '2nd middleware')\r\n})\r\n\r\ndiet.get('/', function(){\r\n    console.log('2nd route', '1st middleware')\r\n})\r\n\r\n// diet.mount convert req, res, next to signal that used req, res, next\r\napp.use(diet.mount(options))\r\n\r\n"}}