Skip to content

How to run dev environment on azure VM? #3101

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

Closed
estradamarkie opened this issue Nov 10, 2016 · 5 comments
Closed

How to run dev environment on azure VM? #3101

estradamarkie opened this issue Nov 10, 2016 · 5 comments

Comments

@estradamarkie
Copy link

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 8/10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
angular-cli: 1.0.0-beta.19-3
node: 6.9.1
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
It was created using the CLI

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.

I'm running angular-cli on my azure VM which works fine when I test it within the box however when I try to access it outside the box it doesn't show up. Though the ports are all good when I was running the quickstart angular without CLI that was showing okay.

I changed the angular-cli port from 4200 (default) to 3000 (using .ember-cli) to match my box port but it. Do I need to configure something in the angular-cli itself? I don't want to build a --prod yet.


Thanks! We'll be in touch soon.

@estradamarkie
Copy link
Author

estradamarkie commented Nov 10, 2016

Run it using ng serve --host 0.0.0.0 which works fine, looks like the default IP is just 127.0.0.1 but other than localhost it won't allow you access it outside. Does anyone which package is this binding or making it use 127.0.0.1? as I don't want to always ng serve --host 0.0.0.0 just want to ng serve and should good to go.

@celliott181
Copy link
Contributor

celliott181 commented Nov 10, 2016

The place you're looking for is over in the Webpack-Dev-Server repos (https://github.com/webpack/webpack-dev-server/blob/master/bin/webpack-dev-server.js#L192)

Here's the thing: I'm almost certain the team doesn't bind to 0.0.0.0 because they don't explicitly tell WDS to bind to any host. WDS just uses its default, as seen in the linked file. Also, whenever binding to localhost isn't going to work, the use of --host is the recommended answer. @filipesilva also made it known in #1793 that the old configuration options where this used to be set would be stripped, and true to his word, the old .ember-cli configuration is no longer available, nor would it apply since changing dev servers.

What you need is to add a script to your package.json along the lines of "start": "ng serve --host 0.0.0.0", and then start your project with npm start rather than ng serve.

@estradamarkie
Copy link
Author

@gelliott181

Thanks for your answer, I found the .ember-cli when I was searching how to change 4200 to something else. Is there another way of changing the default port 4200 to say 3000? Though .ember-cli seems to be still working as I'm running my app on a different port than 4200.

Will try to add the that script in my package.json.

@estradamarkie
Copy link
Author

@gelliott181 never mind about my question about port, I put in my script --port xxxx and now its running on that port.

Thanks for clearing things.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants