在本地计算机上运行的NodeJS和MAMP.是否有可能?

问题描述:

是否可以在同一台计算机上同时运行NodeJS和MAMP?如果是这样,我将如何实现?

Is it possible to have NodeJS and MAMP running together on the same machine? If so how would i achieve this?

注意:我可以单独运行它们,但不能一起运行.我假设使用"localhost"和MAMP来归结到我的NodeJS.

Note: I can run them separately just not together. I assume its down to my NodeJS using the "localhost" as well as MAMP.

您可以设置代理和主机.

You can setup Proxy and a host.

例如在主机"中创建node01.example.com.然后转到高级",然后在自定义虚拟主机常规设置"中输入以下内容

for example create node01.example.com in Hosts. Then Go to Advanced and enter the following in "Customized virtual host general settings"


ServerAlias node01.example.com

 <Location />

  ProxyPass http://127.0.0.1:3000/

ProxyPassReverse http://127.0.0.1:3000/

</Location>

当您访问node01.example.com时,您将通过MAMP并转到您的节点;)

when you visit node01.example.com you'd pass through MAMP and go to your node ;)