Cameron
Cameron

Reputation: 2965

Can I serve my localhost from a different port other than 4200 in EmberJS?

Normally, when a user calls

ember serve

The local host is always 4200 by default. It would be nice if I could specify a different port so that I could have two ember web apps running. Is it possible to have a ember serve a different port?

The reason I care is that I'm using one of my web apps to help me build the other, and it would be convenient to have them both running at the same time so that I don't keep going back and forth with my builds.

Upvotes: 8

Views: 7021

Answers (2)

H.yum
H.yum

Reputation: 71

Yes, you can specify the ports for your ember apps:

ember server --port 1234 --live-reload-port 1235

Upvotes: 5

Gokul Kathirvel
Gokul Kathirvel

Reputation: 1610

yeah, of course, you can! you can either pass the --port arg directly to the serve command as - ember serve --port=4201 or else you can specify in the .ember-cli file (will be present in your root directory) as follow

{
  /**
    Ember CLI sends analytics information by default. The data is completely
    anonymous, but there are times when you might want to disable this behavior.

    Setting `disableAnalytics` to true will prevent any data from being sent.
  */
  "disableAnalytics": false,
  "port": 4201
}

if you mention this in .ember-cli file, then ember serve will run in the specified port by default.

Upvotes: 17

Related Questions