2017-05-31 64 views
2

通常情況下,當用戶調用我可以在EmberJS中從4200以外的其他端口服務我的本地主機嗎?

ember serve

本地主機始終是4200默認情況下。如果我可以指定一個不同的端口以便我可以運行兩個燼網絡應用程序,那將會很好。有沒有可能有一個燼點服務於不同的端口?

我關心的原因是我正在使用我的一個Web應用程序來幫助我構建其他應用程序,並且讓它們同時運行會很方便,這樣我就不會再回頭了,隨着我的建設。

回答

4

是的,當然,你可以!您可以直接通過--port ARG到服務命令 - ember serve --port=4201否則你可以在.ember-cli文件(將出現在您的根目錄)指定爲遵循

{ 
    /** 
    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 
} 

如果您提及這.ember- cli文件,那麼默認情況下,ember serve將在指定的端口中運行。

1

是的,你可以爲你的應用程序的餘燼指定端口:

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

這並不提供答案的問題。一旦你有足夠的[聲譽](https://stackoverflow.com/help/whats-reputation),你將可以[對任何帖子發表評論](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/18185267) – Sergey

相關問題