{"action":"opened","issue":{"url":"https://api.github.com/repos/gocraft/web/issues/59","repository_url":"https://api.github.com/repos/gocraft/web","labels_url":"https://api.github.com/repos/gocraft/web/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/gocraft/web/issues/59/comments","events_url":"https://api.github.com/repos/gocraft/web/issues/59/events","html_url":"https://github.com/gocraft/web/issues/59","id":130817340,"number":59,"title":"Need help passing in a configuration value to middleware","user":{"login":"tleyden","id":296876,"avatar_url":"https://avatars.githubusercontent.com/u/296876?v=3","gravatar_id":"","url":"https://api.github.com/users/tleyden","html_url":"https://github.com/tleyden","followers_url":"https://api.github.com/users/tleyden/followers","following_url":"https://api.github.com/users/tleyden/following{/other_user}","gists_url":"https://api.github.com/users/tleyden/gists{/gist_id}","starred_url":"https://api.github.com/users/tleyden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleyden/subscriptions","organizations_url":"https://api.github.com/users/tleyden/orgs","repos_url":"https://api.github.com/users/tleyden/repos","events_url":"https://api.github.com/users/tleyden/events{/privacy}","received_events_url":"https://api.github.com/users/tleyden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-02T21:09:26Z","updated_at":"2016-02-02T21:09:26Z","closed_at":null,"body":"I've added [middleware](https://github.com/tleyden/todolite-appserver/blob/master/cmd/webserver.go#L21) which will [connect to the database](https://github.com/tleyden/todolite-appserver/blob/master/libtodolite/webserver.go#L18-L32) if there's not already a database connection for that context.\r\n\r\nCurrently the DB url is hardcoded, but the plan is to have it passed in as a command line parameter by the user.  What's the recommended way to pass the in the DB url to the middleware?  Are there any examples of middleware objects that are initialized with options?\r\n"}}