简体   繁体   English

如何在现有网站中实现 Node.js 聊天应用程序?

[英]How to implement a Node.js chat app into an existing website?

I've been getting into Node.js recently and I really like the example shown on Socket.io's website showing a real time chat application.我最近一直在研究 Node.js,我真的很喜欢 Socket.io 网站上显示的实时聊天应用程序的示例。 However, in all of the examples I see the URL used is localhost:8080 or whatever ip and port is applicable.但是,在所有示例中,我看到使用的 URL 是 localhost:8080 或任何 ip 和端口都适用。 However, is there any way to implement this into an existing webpage so that it isn't a separate URL?但是,有什么方法可以将其实现到现有网页中,使其不是单独的 URL? If not, how are these real-time chat apps done in real life?如果没有,这些实时聊天应用在现实生活中是如何完成的?

these sort of questions are usually not meant for stackoverflow, but everyone has been where you are, Stackoverflow is dedicated for code related questions: but this might help you get to your next steps:这类问题通常不适用于 stackoverflow,但每个人都在您所在的位置,Stackoverflow 专门用于与代码相关的问题:但这可能会帮助您进行下一步:

NodeJS is a backend server language, you will have to deploy it to a production environment. NodeJS 是一种后端服务器语言,您必须将其部署到生产环境中。

New developers typically learn by using services like heroku.com to quickly host backend apps, they take a lot of the complexity of learning Linux or Microrost Server out of the mix, but they are not typically used by more advanced developers.新开发人员通常通过使用 heroku.com 之类的服务来快速托管后端应用程序来学习,他们在学习 Linux 或 Microrost Server 时花费了很多复杂性,但更多高级开发人员通常不会使用它们,但它们通常不会被更多高级开发人员使用。

More advanced (real world apps) run on AWS/Azure/Other hosts.更高级的(现实世界的应用程序)在 AWS/Azure/其他主机上运行。

Implementing it in an existing website requires both frontend and backend languages.在现有网站中实现它需要前端和后端语言。 Nodejs gives you a leg up in that it's javascript, and can run in both frontend and backend situations. Nodejs 为您提供了支持,因为它是 javascript,并且可以在前端和后端两种情况下运行。

There are many places online that provide tutorials for creating backend servers and frontend websites.网上有很多地方提供创建后端服务器和前端网站的教程。

the list is endless, but some good places for new developers are清单是无穷无尽的,但对于新开发人员来说,一些好地方是

https://frontendmasters.com/ https://frontendmasters.com/

https://teamtreehouse.com/ https://teamtreehouse.com/

https://egghead.io/ https://egghead.io/

Here is a tutorial on heroku for setting up a nodejs app Getting Started on Heroku with Node.js这是关于 heroku 的教程,用于设置 nodejs 应用程序使用 Node.js 在 Heroku 上入门

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

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