angular-http-server icon indicating copy to clipboard operation
angular-http-server copied to clipboard

baseHref does not work

Open dimitriy-k opened this issue 5 years ago • 4 comments
trafficstars

dist/myapp/index.html: <base href="/my/app/here/">

command: npx angular-http-server -p 9001 --path dist/myapp --baseHref '/my/app/here/'

it cannot resolve all .js files, so it returns index.html for each request: Route dummy, replacing with index.html

dimitriy-k avatar Nov 05 '20 10:11 dimitriy-k

ok, looked in your code, baseHref should be without first /, so --baseHref 'my/app/here/', then it works

dimitriy-k avatar Nov 05 '20 10:11 dimitriy-k

Is there an issue here, or can we close?

simonh1000 avatar Feb 06 '21 08:02 simonh1000

if you know that for this lib baseHref should be used without first / then there is no issue. But normally nobody will know it. So, you can put it in documentation, or better update your code to check when / is needed to add it, so both cases will be valid: --baseHref 'my/app/here/' and --baseHref '/my/app/here/'

dimitriy-k avatar Feb 06 '21 18:02 dimitriy-k

Would you like to convert your learnings into a contribution to the README?

simonh1000 avatar Feb 06 '21 19:02 simonh1000