2

When trying to deploy my Angular2 app. I need to test if build works fine.

I get empty page when trying to do so !

Is dist/index.html can be used to directly open the app using browser ?

1
  • 3
    No. It should be served by a web server. Commented Mar 8, 2017 at 11:21

2 Answers 2

3

You have to deploy the content of your dist/ dir to a web server (think Caddy, nginx, Apache, etc.).

Then you can test the app got built ok.

Sign up to request clarification or add additional context in comments.

2 Comments

why it doesn't work by double clicking index.html since it's just html/css/js ?
@Cleancoder: I guess, it's due to AJAX calls using HTTP - your local files would use file://. There also might be problems related to the paths in app.
2

in linux

  1. Open the terminal, address to src/dist path
  2. type python -m SimpleHTTPServer
  3. Open your browser and type localhost:8000

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.