{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/255","labels_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/255/comments","events_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/255/events","html_url":"https://github.com/webpack/webpack-dev-server/pull/255","id":104978151,"number":255,"title":"Added support for multiple static virtual paths","user":{"login":"ctindel","id":1863749,"avatar_url":"https://avatars.githubusercontent.com/u/1863749?v=3","gravatar_id":"","url":"https://api.github.com/users/ctindel","html_url":"https://github.com/ctindel","followers_url":"https://api.github.com/users/ctindel/followers","following_url":"https://api.github.com/users/ctindel/following{/other_user}","gists_url":"https://api.github.com/users/ctindel/gists{/gist_id}","starred_url":"https://api.github.com/users/ctindel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctindel/subscriptions","organizations_url":"https://api.github.com/users/ctindel/orgs","repos_url":"https://api.github.com/users/ctindel/repos","events_url":"https://api.github.com/users/ctindel/events{/privacy}","received_events_url":"https://api.github.com/users/ctindel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-04T22:07:10Z","updated_at":"2016-01-20T14:29:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/pulls/255","html_url":"https://github.com/webpack/webpack-dev-server/pull/255","diff_url":"https://github.com/webpack/webpack-dev-server/pull/255.diff","patch_url":"https://github.com/webpack/webpack-dev-server/pull/255.patch"},"body":"I looked through a lot of different node.js projects before writing this trying to find a way to do what I want to do.  Given a complicated source tree that has a number of different subdirectories all supplying some static files I wanted a way to be able to define multiple static virtual paths for the webpack-dev-server.  \r\n\r\nSo, I added support for a new parameter \"staticRoutes\" which expects an array of objects that have a route and dir fields.  route specifies the static route as it will be seen from the browser and dir specifies a the directory in your source tree that will host those files.  For example:\r\n\r\n```\r\nvar config = {\r\n  devServer: {\r\n    contentBase: 'src/public',\r\n    publicPath: '/__build__',\r\n    staticRoutes: [ { 'route': '/npm_scripts', 'dir' : __dirname + '/node_modules'},\r\n                    { 'route': '/bower_scripts', 'dir' : __dirname + '/bower_components'} ]\r\n  }\r\n}\r\n```\r\n\r\nNow you will be able to specify something like:\r\n\r\n```\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/npm_scripts/bootstrap/dist/css/bootstrap.css\">\r\n<script src=\"/bower_scripts/jquery/dist/jquery.js\"></script>\r\n```\r\n\r\nIn your html and those files will be served appropriately."},"comment":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/comments/173220644","html_url":"https://github.com/webpack/webpack-dev-server/pull/255#issuecomment-173220644","issue_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/255","id":173220644,"user":{"login":"ctindel","id":1863749,"avatar_url":"https://avatars.githubusercontent.com/u/1863749?v=3","gravatar_id":"","url":"https://api.github.com/users/ctindel","html_url":"https://github.com/ctindel","followers_url":"https://api.github.com/users/ctindel/followers","following_url":"https://api.github.com/users/ctindel/following{/other_user}","gists_url":"https://api.github.com/users/ctindel/gists{/gist_id}","starred_url":"https://api.github.com/users/ctindel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctindel/subscriptions","organizations_url":"https://api.github.com/users/ctindel/orgs","repos_url":"https://api.github.com/users/ctindel/repos","events_url":"https://api.github.com/users/ctindel/events{/privacy}","received_events_url":"https://api.github.com/users/ctindel/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T14:29:08Z","updated_at":"2016-01-20T14:29:08Z","body":"https://github.com/sokra"}}