0

When running my angular project, I want to change the localhost url to projectname.

localhost:4200 to projectName:4200

How should I proceed?

1

2 Answers 2

1

When you start the serve with ng serve, just add host:

ng serve --host="projectName".

Here are all parameters accepted by serve: Angular ng serve Docs

IMPORTANT
This implies that you cannot serve the app if you don't have any address with that name

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

Comments

0

I solved, I added 127.0.0.1 projectName in the file "C: \ Windows \ System32 \ drivers \ etc \ hosts". Later, when I typed "ipconfig / flushdns" at the command line, I made "ng serve --host projectName" again and my project worked on projectName: 4200.

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.