{"action":"created","issue":{"url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/10","repository_url":"https://api.github.com/repos/i18next/i18next-express-middleware","labels_url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/10/comments","events_url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/10/events","html_url":"https://github.com/i18next/i18next-express-middleware/issues/10","id":132259629,"number":10,"title":"Cannot read property 'split' of undefined","user":{"login":"ttyieu","id":1408542,"avatar_url":"https://avatars.githubusercontent.com/u/1408542?v=3","gravatar_id":"","url":"https://api.github.com/users/ttyieu","html_url":"https://github.com/ttyieu","followers_url":"https://api.github.com/users/ttyieu/followers","following_url":"https://api.github.com/users/ttyieu/following{/other_user}","gists_url":"https://api.github.com/users/ttyieu/gists{/gist_id}","starred_url":"https://api.github.com/users/ttyieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttyieu/subscriptions","organizations_url":"https://api.github.com/users/ttyieu/orgs","repos_url":"https://api.github.com/users/ttyieu/repos","events_url":"https://api.github.com/users/ttyieu/events{/privacy}","received_events_url":"https://api.github.com/users/ttyieu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-08T21:21:20Z","updated_at":"2016-02-09T07:29:05Z","closed_at":null,"body":"So, according to the README, function `middleware.getResourcesHandler` is supposed to be used like this:\r\n```javascript\r\napp.get('/locales/resources.json', middleware.getResourcesHandler(i18next))\r\n```\r\nIf I understand it right, the params for `lng` and `ns` have to be set through the query string, because this function reads them from `req.query`. But when these params are not passed, the function throws an error:\r\n```\r\nTypeError: Cannot read property 'split' of undefined\r\n   at /usr/src/node_modules/i18next-express-middleware/lib/index.js:114:57\r\n```\r\nShouldn't it at least check first if the params are set?\r\nAnd more importantly, why can't we read the language from `req.lng` or `req.params.lng` here, as it is in the rest of the module?"},"comment":{"url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/comments/181745100","html_url":"https://github.com/i18next/i18next-express-middleware/issues/10#issuecomment-181745100","issue_url":"https://api.github.com/repos/i18next/i18next-express-middleware/issues/10","id":181745100,"user":{"login":"jamuhl","id":977772,"avatar_url":"https://avatars.githubusercontent.com/u/977772?v=3","gravatar_id":"","url":"https://api.github.com/users/jamuhl","html_url":"https://github.com/jamuhl","followers_url":"https://api.github.com/users/jamuhl/followers","following_url":"https://api.github.com/users/jamuhl/following{/other_user}","gists_url":"https://api.github.com/users/jamuhl/gists{/gist_id}","starred_url":"https://api.github.com/users/jamuhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamuhl/subscriptions","organizations_url":"https://api.github.com/users/jamuhl/orgs","repos_url":"https://api.github.com/users/jamuhl/repos","events_url":"https://api.github.com/users/jamuhl/events{/privacy}","received_events_url":"https://api.github.com/users/jamuhl/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T07:29:05Z","updated_at":"2016-02-09T07:29:05Z","body":"1) right: will add the check\r\n2) this route is not for internal use - but is used to get resources down to the client (browser). The browser can request any set of language, namespace combination."}}