本文介绍了在本地计算机上运行的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 ;)

这篇关于在本地计算机上运行的NodeJS和MAMP.是否有可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:21