Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build & hosted on Apache(httpd) #814

Closed
sysmat opened this issue May 18, 2016 · 3 comments
Closed

ng build & hosted on Apache(httpd) #814

sysmat opened this issue May 18, 2016 · 3 comments

Comments

@sysmat
Copy link

sysmat commented May 18, 2016

Hi I'm new to angular2 and angular-cli, great work for this command line tool.

  1. Windows 7
  2. ng --version
    angular-cli: 1.0.0-beta.1
    node: 5.9.1
    os: win32 x64
  3. I create app, generate component add route and ng serve works fine and application is served at http://localhost:4200/.
    With ng build(production: true) I create dist and content copy to application hosted on Apache server(http://localhost/myAngular2), but application is not working, because of broken links for js.
  4. LOG:
    http://localhost/vendor/reflect-metadata/Reflect.js Failed to load resource: the server responded with a status of 404 (Not Found)
    http://localhost/vendor/zone.js/dist/zone.js Failed to load resource: the server responded with a status of 404 (Not Found)
    http://localhost/vendor/systemjs/dist/system.src.js Failed to load resource: the server responded with a status of 404 (Not Found)
    http://localhost/vendor/es6-shim/es6-shim.js Failed to load resource: the server responded with a status of 404 (Not Found)
    localhost/:32 Uncaught ReferenceError: System is not defined
  5. Is any way to build generated apllication with some host or application prefix?

Regards, Tomaz

@hijoncon
Copy link

hijoncon commented May 18, 2016

Yes you will got 404. In your index.html under dist. Try to change the path example below:
src="myAngular2/vendor/es6-shim/es6-shim.js

I think ng build -prod had some issues. But try to build just ng build

@filipesilva
Copy link
Contributor

If you're serving it under http://localhost/myAngular2, you need to change the <base href="/"> tag in the generated dist/index.html.

Currently there is no way of doing it automatically, but there is an issue for it here #646

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants