简体   繁体   English

如何在Magento商店中运行Node.js应用程序?

[英]How to run Node.js app in Magento store?

I want to go www.mymagentostore.com/design and start running the node.js application. 我想去www.mymagentostore.com/design并开始运行node.js应用程序。 This application will produce a list of products, will add them to the cart and will redirect the user back to the store or to the checkout page. 该应用程序将生成产品列表,将其添加到购物车中,并将用户重定向回商店或结帐页面。

I am not sure on how to implement this? 我不确定如何执行此操作? Could you please advise, suggest or point to the example? 您能否提供建议,建议或指向示例?

my thoughts: 1. Run www.mymagentostore.com on port 5000 2.once design button is clicked redirect user to www.mymagentostore.com/design on port 7777 3. Express framework on Node will listen on this port 7777 and route , will run the app , produce results, and will redirect back to www.mymagentostore.com on port 5000 我的想法:1.在端口5000上运行www.mymagentostore.com 2.单击设计按钮,将用户重定向到端口7777上的www.mymagentostore.com/design 3. Node上的Express框架将在此端口7777上侦听并路由,将运行该应用程序,产生结果,并将在端口5000上重定向回www.mymagentostore.com

Some questions arise if I think of implementation above: 如果我想到上面的实现,则会出现一些问题:

Can I run php server on one port and node server on another one? 我可以在一个端口上运行php服务器,在另一个端口上运行节点服务器吗? Can I run magento and node on the same domain name? 我可以在同一域名上运行magento和node吗? Will magento router cause problems for node router listener? magento路由器会导致节点路由器侦听器出现问题吗?

You can accomplish this via proxying in your webserver. 您可以通过Web服务器中的代理来完成此操作。

You can setup a directory alias in your webserver and have it proxy to the node.js app. 您可以在Web服务器中设置目录别名,并将其代理到node.js应用程序。

An example: How to rewrite / proxy an Apache URI to an application listening on a specific port / server? 示例: 如何将Apache URI重写/代理到侦听特定端口/服务器的应用程序?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM