{"action":"created","issue":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/975","labels_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/975/labels{/name}","comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/975/comments","events_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/975/events","html_url":"https://github.com/rejectedsoftware/vibe.d/issues/975","id":56511268,"number":975,"title":"REST Interface works in debug mode but not in release mode","user":{"login":"stonemaster","id":1463490,"avatar_url":"https://avatars.githubusercontent.com/u/1463490?v=3","gravatar_id":"","url":"https://api.github.com/users/stonemaster","html_url":"https://github.com/stonemaster","followers_url":"https://api.github.com/users/stonemaster/followers","following_url":"https://api.github.com/users/stonemaster/following{/other_user}","gists_url":"https://api.github.com/users/stonemaster/gists{/gist_id}","starred_url":"https://api.github.com/users/stonemaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stonemaster/subscriptions","organizations_url":"https://api.github.com/users/stonemaster/orgs","repos_url":"https://api.github.com/users/stonemaster/repos","events_url":"https://api.github.com/users/stonemaster/events{/privacy}","received_events_url":"https://api.github.com/users/stonemaster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-04T10:50:11Z","updated_at":"2015-02-15T22:12:20Z","closed_at":null,"body":"The code example below produces a perfectly valid output for ```localhost:8080/api/v1/test``` in debug mode but returns the following output when compiled in **release** (dub) mode:\r\n\r\n```\r\n404 - Not Found\r\n\r\nNot Found\r\n\r\nInternal error information:\r\nNot routes match path '/api/v1/test'\r\n```\r\n\r\nVerbose mode also prints ```no route match: GET /api/v1/test``` although a log message at startup says that it has been registered.\r\n\r\nCode example:\r\n```D\r\nimport vibe.d;\r\n\r\nshared static this() {\r\n        auto settings = new HTTPServerSettings;\r\n        settings.port = 8080;\r\n        settings.bindAddresses = [\"::1\", \"127.0.0.1\"];\r\n        auto router = new URLRouter;\r\n        router.registerRestInterface(new RestInterface);\r\n        listenHTTP(settings, router);\r\n}\r\n\r\ninterface IRest {\r\n        struct V {\r\n                string name;\r\n                int id;\r\n        }\r\n\r\n        @path(\"/api/v1/test\")\r\n        V[] getTest();\r\n\r\n}\r\n\r\nclass RestInterface: IRest {\r\n        V[] getTest()\r\n        {\r\n                return [ V(\"test1\", 1), V(\"test2\", 2)];\r\n        }\r\n}\r\n```\r\n\r\nVibe.d version 0.7.22"},"comment":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/comments/74440130","html_url":"https://github.com/rejectedsoftware/vibe.d/issues/975#issuecomment-74440130","issue_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/975","id":74440130,"user":{"login":"s-ludwig","id":1645969,"avatar_url":"https://avatars.githubusercontent.com/u/1645969?v=3","gravatar_id":"","url":"https://api.github.com/users/s-ludwig","html_url":"https://github.com/s-ludwig","followers_url":"https://api.github.com/users/s-ludwig/followers","following_url":"https://api.github.com/users/s-ludwig/following{/other_user}","gists_url":"https://api.github.com/users/s-ludwig/gists{/gist_id}","starred_url":"https://api.github.com/users/s-ludwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-ludwig/subscriptions","organizations_url":"https://api.github.com/users/s-ludwig/orgs","repos_url":"https://api.github.com/users/s-ludwig/repos","events_url":"https://api.github.com/users/s-ludwig/events{/privacy}","received_events_url":"https://api.github.com/users/s-ludwig/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T22:12:20Z","updated_at":"2015-02-15T22:12:20Z","body":"There is currently just `-b plain` which disables debug information, but doesn't specify `-O inline`. But there is always the possibility to either use `DFLAGS=`-O -inline` (or `DFLAGS=`-release -O -inline -boundscheck=on`), or to define custom flags within dub.json. But there is no `\"buildOptions\"` constant and no default build mode for this right now."}}