{"action":"created","issue":{"url":"https://api.github.com/repos/mgechev/angular2-seed/issues/749","repository_url":"https://api.github.com/repos/mgechev/angular2-seed","labels_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/749/comments","events_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/749/events","html_url":"https://github.com/mgechev/angular2-seed/issues/749","id":147775408,"number":749,"title":"app_base causing issues when serving content statically from a subfolder","user":{"login":"mpetkov","id":8858458,"avatar_url":"https://avatars.githubusercontent.com/u/8858458?v=3","gravatar_id":"","url":"https://api.github.com/users/mpetkov","html_url":"https://github.com/mpetkov","followers_url":"https://api.github.com/users/mpetkov/followers","following_url":"https://api.github.com/users/mpetkov/following{/other_user}","gists_url":"https://api.github.com/users/mpetkov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetkov/subscriptions","organizations_url":"https://api.github.com/users/mpetkov/orgs","repos_url":"https://api.github.com/users/mpetkov/repos","events_url":"https://api.github.com/users/mpetkov/events{/privacy}","received_events_url":"https://api.github.com/users/mpetkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-12T14:48:36Z","updated_at":"2016-04-13T06:57:54Z","closed_at":null,"body":"The current setup works great if you serve the prod content one of the ways:\r\n\r\n- Using node with the serve.prod command.\r\n\r\n- Running it on a web server statically but the domain has to be at the root level.\r\n\r\nHowever, if you want to serve it by a web server through a subdomain, like so: www.example.com/content/, it will not load the style and js assets from index.html.  This is because it uses the app_base to serve this content which the seed wants you to setup before packaging for prod.  But most of the time the app could be deployed in a bunch of different testing and live locations so there is no way to preset that app base.\r\n\r\nSo the real question is what is the benefit of having the app base if the app can just load it all by using relative paths?\r\n\r\nHere is the solution that I did until there is something better:\r\n**index.html**\r\nRemoved following lines:\r\n`<base href=\"<%= APP_BASE %>\">`\r\n\r\n**tools/tasks/seed/build.index.prod.ts**\r\nRemoved APP_BASE by changing this line:\r\nFrom this:\r\n`arguments[0] = APP_BASE + path.slice(3, path.length).join(sep) + '?${Date.now()}';`\r\nTo this:\r\n`arguments[0] = path.slice(3, path.length).join(sep) + '?${Date.now()}';`"},"comment":{"url":"https://api.github.com/repos/mgechev/angular2-seed/issues/comments/209262148","html_url":"https://github.com/mgechev/angular2-seed/issues/749#issuecomment-209262148","issue_url":"https://api.github.com/repos/mgechev/angular2-seed/issues/749","id":209262148,"user":{"login":"ludohenin","id":1011516,"avatar_url":"https://avatars.githubusercontent.com/u/1011516?v=3","gravatar_id":"","url":"https://api.github.com/users/ludohenin","html_url":"https://github.com/ludohenin","followers_url":"https://api.github.com/users/ludohenin/followers","following_url":"https://api.github.com/users/ludohenin/following{/other_user}","gists_url":"https://api.github.com/users/ludohenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ludohenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ludohenin/subscriptions","organizations_url":"https://api.github.com/users/ludohenin/orgs","repos_url":"https://api.github.com/users/ludohenin/repos","events_url":"https://api.github.com/users/ludohenin/events{/privacy}","received_events_url":"https://api.github.com/users/ludohenin/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T06:57:54Z","updated_at":"2016-04-13T06:57:54Z","body":"What I did for this use case is to add a cli arg `--dest` and config `APP_DEST`. This way I can ship several envs while still packaging for prod. Another good option to have is the `APP_ENV` (build prod but with app dev config for instance).\r\n* example build.stage: `gulp build.prod --env prod --app-env dev --dest stage --base /stage/`\r\n\r\n> So the real question is what is the benefit of having the app base if the app can just load it all by using relative paths?\r\n\r\nThis breaks loading the app from a deep-link when using the router."}}