我可以在EmberJS中从4200以外的其他端口服务我的本地主机吗?

问题描述:

通常情况下,当用户调用我可以在EmberJS中从4200以外的其他端口服务我的本地主机吗?

ember serve

本地主机始终是4200默认情况下。如果我可以指定一个不同的端口以便我可以运行两个烬网络应用程序,那将会很好。有没有可能有一个烬点服务于不同的端口?

我关心的原因是我正在使用我的一个Web应用程序来帮助我构建其他应用程序,并且让它们同时运行会很方便,这样我就不会再回头了,随着我的建设。

是的,当然,你可以!您可以直接通过--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将在指定的端口中运行。

是的,你可以为你的应用程序的余烬指定端口:

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