{"action":"opened","issue":{"url":"https://api.github.com/repos/mongo-express/mongo-express/issues/244","repository_url":"https://api.github.com/repos/mongo-express/mongo-express","labels_url":"https://api.github.com/repos/mongo-express/mongo-express/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/mongo-express/mongo-express/issues/244/comments","events_url":"https://api.github.com/repos/mongo-express/mongo-express/issues/244/events","html_url":"https://github.com/mongo-express/mongo-express/issues/244","id":166869106,"number":244,"title":"Use as middleware doesn't support routing outside of base level","user":{"login":"smithy545","id":1340763,"avatar_url":"https://avatars.githubusercontent.com/u/1340763?v=3","gravatar_id":"","url":"https://api.github.com/users/smithy545","html_url":"https://github.com/smithy545","followers_url":"https://api.github.com/users/smithy545/followers","following_url":"https://api.github.com/users/smithy545/following{/other_user}","gists_url":"https://api.github.com/users/smithy545/gists{/gist_id}","starred_url":"https://api.github.com/users/smithy545/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smithy545/subscriptions","organizations_url":"https://api.github.com/users/smithy545/orgs","repos_url":"https://api.github.com/users/smithy545/repos","events_url":"https://api.github.com/users/smithy545/events{/privacy}","received_events_url":"https://api.github.com/users/smithy545/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-21T17:01:03Z","updated_at":"2016-07-21T17:01:03Z","closed_at":null,"body":"I tried to use lib/middleware.js by using it on a router instead of on the base app but it would redirect to the wrong location. I had to use lib/router and copy all the template files my views directory to get it to work.\r\n\r\nFor example I would set it up like this:\r\napp.js\r\n```\r\napp.use('/admin' , require('./routes/admin'));\r\n```\r\nadmin.js\r\n```\r\nvar mongo_express = require('mongo-express/lib/router');\r\nvar mongo_express_config = require('../config/admin.js');\r\n\r\nvar admin = express.Router();\r\nadmin.use('/', mongo_express(mongo_express_config));\r\n```\r\n\r\nAnd when I clicked links on the page instead of redirecting to 'www.mywebsite.com/admin/db/dbname' it would redirect to 'www.mywebsite.com/db/dbname'. I tried changing the base url but that did nothing. I'm using the router.js file directly now but my default template language is different so it's kind of a pain. If there's a fix I'm not seeing please let me know."}}
{"actor":{"display_login":"smithy545"}}