简体   繁体   English

如何托管一个 node.js Web 服务器,该服务器可以使用 GitHub 页面或 InfinityFree 处理端口中的请求

[英]How to host a node.js web server that can handle requests in port with GitHub pages or InfinityFree

I know this question's answer can be easily looked up in google but sadly I didn't get the answer to my question.我知道这个问题的答案可以很容易地在谷歌中查找,但遗憾的是我没有得到我的问题的答案。

I want to know how to host a node.js web server that can handle requests in Github Pages.我想知道如何托管可以处理 Github Pages 中的请求的node.js Web 服务器。

If it isn't possible in Github Pages, then in any other hosting service (preferably InfinityFree ).如果在 Github Pages 中不可能,那么在任何其他托管服务中(最好是InfinityFree )。

GitHub Pages is a static hosting provider, meaning that it does not provide any way to host server-side logic. GitHub Pages 是一个静态托管服务提供商,这意味着它不提供任何托管服务器端逻辑的方法。

According to InfinityFree's forums, they do not support any server-side language other than PHP (including Node.js) as of current.根据 InfinityFree 的论坛,截至目前它们不支持除 PHP(包括 Node.js)之外的任何服务器端语言。

If you are looking for a free provider that would allow you to run a Node.js program, you can look into Heroku or serverless platforms such as Netlify and Vercel .如果您正在寻找允许您运行 Node.js 程序的免费提供商,您可以查看Heroku或无服务器平台,例如NetlifyVercel It is worth noting that, being free, all of these providers have their own limitations and requirements.值得注意的是,由于是免费的,所有这些提供商都有自己的限制和要求。

If you're willing to pay, you can rent a virtual private server from a provider such as Microsoft Azure or Amazon's AWS for a small amount (exact amount dependent on your location), or make use of their serverless offerings.如果您愿意付费,您可以从 Microsoft Azure 或 Amazon 的 AWS 等提供商处以少量(具体金额取决于您的位置)租用虚拟专用服务器,或使用他们的无服务器产品。

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

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