{"action":"created","issue":{"url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/6","repository_url":"https://api.github.com/repos/colthreepv/express-raml-store","labels_url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/6/comments","events_url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/6/events","html_url":"https://github.com/colthreepv/express-raml-store/issues/6","id":153991262,"number":6,"title":"Static api-designer path issue npm v3","user":{"login":"OliverFischer","id":1994440,"avatar_url":"https://avatars.githubusercontent.com/u/1994440?v=3","gravatar_id":"","url":"https://api.github.com/users/OliverFischer","html_url":"https://github.com/OliverFischer","followers_url":"https://api.github.com/users/OliverFischer/followers","following_url":"https://api.github.com/users/OliverFischer/following{/other_user}","gists_url":"https://api.github.com/users/OliverFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/OliverFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OliverFischer/subscriptions","organizations_url":"https://api.github.com/users/OliverFischer/orgs","repos_url":"https://api.github.com/users/OliverFischer/repos","events_url":"https://api.github.com/users/OliverFischer/events{/privacy}","received_events_url":"https://api.github.com/users/OliverFischer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-10T12:12:08Z","updated_at":"2016-06-03T12:20:54Z","closed_at":null,"body":"Hi,\r\n\r\nif we host the express-raml-store as part of our application and using npm v3 the styles and scripts of the api designer are not found. While the index file is delivered with respect to the npm version, the api-designer resources aren't. \r\n\r\nAs shown here : \r\n````\r\ntry { // support both npm 2.x and 3.x\r\n  // npm 2.x subdir\r\n  indexFile = fs.readFileSync(path.join(__dirname, 'node_modules/api-designer/dist/index.html'), 'utf8');\r\n} catch (err) {\r\n  // npm 3.x brother dir\r\n  indexFile = fs.readFileSync(path.join(__dirname, '..', '/api-designer/dist/index.html'), 'utf8');\r\n}\r\n````\r\nin contrast  to : \r\n````\r\nres.sendFile(requestedFile, { root: path.join(__dirname, 'node_modules/api-designer/dist') }, function (err) {\r\n    if (err && err.code === 'ENOENT') return res.sendStatus(404);\r\n    if (err) return next(err);\r\n  });\r\n````\r\n\r\nWe had to modify the path to walk one directory up \r\n````\r\nres.sendFile(requestedFile, { root: path.join(__dirname, '../api-designer/dist') }, function \r\n````\r\nto make it work. Is this intended? \r\n\r\nGreetings Olli"},"comment":{"url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/comments/223564449","html_url":"https://github.com/colthreepv/express-raml-store/issues/6#issuecomment-223564449","issue_url":"https://api.github.com/repos/colthreepv/express-raml-store/issues/6","id":223564449,"user":{"login":"arcesino","id":847819,"avatar_url":"https://avatars.githubusercontent.com/u/847819?v=3","gravatar_id":"","url":"https://api.github.com/users/arcesino","html_url":"https://github.com/arcesino","followers_url":"https://api.github.com/users/arcesino/followers","following_url":"https://api.github.com/users/arcesino/following{/other_user}","gists_url":"https://api.github.com/users/arcesino/gists{/gist_id}","starred_url":"https://api.github.com/users/arcesino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcesino/subscriptions","organizations_url":"https://api.github.com/users/arcesino/orgs","repos_url":"https://api.github.com/users/arcesino/repos","events_url":"https://api.github.com/users/arcesino/events{/privacy}","received_events_url":"https://api.github.com/users/arcesino/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T12:20:54Z","updated_at":"2016-06-03T12:20:54Z","body":"@OliverFischer Agree with your reasoning. I don't think that was the intended behavior, seems to me more as an incomplete attempt to support both npm versions.\r\n\r\nI have created PR #7 which fixes this issue. I have tested it with both, npm 2.x & 3.x, and in both cases the fix worked.\r\n\r\nHope it helps!\r\n\r\nBest, \r\nNacho"}}
{"actor":{"display_login":"arcesino"}}