小程序 js创建节点
Github:https://github.com/mehulk05/Chat-app-using-Nodejs
GitHub: https : //github.com/mehulk05/Chat-app-using-Nodejs
Live Url:https://chatapp-using-node.herokuapp.com/
实时网址: https : //chatapp-using-node.herokuapp.com/
In this tutorial, we will use the Node.js platform to build a real-time chat application that sends and shows messages to a recipient instantly without any page refresh. Also, we have some validations like if the username is taken then we will have to choose some other username. If two users are in the same room then only they can see the message of each other
在本教程中,我们将使用Node.js平台构建实时聊天应用程序,该应用程序可以立即向收件人发送和显示消息,而无需刷新页面。 另外,我们还有一些验证,例如是否使用了用户名,那么我们将不得不选择其他一些用户名。 如果两个用户在同一个房间中,那么只有他们可以看到彼此的消息
Before we start, let’s have a quick look at the prerequisite
在开始之前,让我们快速了解先决条件
先决条件:(Prerequisite:)
- Basics of Node.js Node.js基础
- Good understanding of Javascript很好地理解Javascript
- Basics of Jquery jQuery的基础
Node.js(Node.js)
Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside the browser. The most important advantage of using Node is that we can use JavaScript as both a front-end and back-end language.
Node.js是一个开源,跨平台JavaScript运行时环境,可在浏览器外部执行JavaScript代码。 使用Node的最重要优势是我们可以将JavaScript既用作前端语言又用作后端语言。
As we know, JavaScript was used primarily for client-side scripting, in which scripts were embedded in a webpage’s HTML and run client-side by a JavaScript engine in the user’s web browser.
众所周知,JavaScript主要用于客户端脚本编写,其中脚本被嵌入到网页HTML中,并由用户Web浏览器中JavaScript引擎在客户端运行。
Node.js lets developers use JavaScript to write Command Line tools and for server-side scripting — running scripts server-side to produce dynamic web page content before the page is sent to the user’s web browser.
Node.js允许开发人员使用JavaScript编写命令行工具和服务器端脚本-在页面发送到用户的Web浏览器之前,在服务器端运行脚本以生成动态网页内容。