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

How to deploy /dist folder to apache web server #1225

Closed
baudo2048 opened this issue Nov 30, 2016 · 2 comments
Closed

How to deploy /dist folder to apache web server #1225

baudo2048 opened this issue Nov 30, 2016 · 2 comments

Comments

@baudo2048
Copy link

baudo2048 commented Nov 30, 2016

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [x] Need a How-To

  • What is the current behavior?
    I've cloned angular2-webpack-starter repository and runned the following commands:

npm install
npm run build:prod

Everything seems ok but when I copy generated /dist folder inside the root of my apache web server and open the app from my web browser at localhost (http://localhost/dist/index.html) nothing appear on the screen except

Loading...

In the browser console there is any message.
From debugger window of my web browser developer tool I can see files that are actually download (i.e. index.html + linked resources). Only two files are downloaded: index.html and analytics.js; that is a little bit strange.

Instead, if I run the following commands:

npm run server

and open my browser at http://0.0.0.0:3000 it works fine.

  • What is the expected behavior?
    To deploy app simply by copy and paste /dist folder to web server public/root folder.

  • Please tell us about your environment:

  • linux mint
  • apache web server
@baudo2048
Copy link
Author

ok I got it!!!
just to know, I've modified the port number at line 26 of https://github.com/AngularClass/angular2-webpack-starter/blob/master/config/webpack.prod.js
from
line26: const PORT = process.env.PORT || 8080;
to
line26: const PORT = process.env.PORT || 80;

After that I've build with
npm run build:prod

and copied and paste /dist folder to the root of my apache web server.

It works.

@joshwiens
Copy link
Contributor

If this question is not longer an issue, can you please close it @baudo2048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants