简体   繁体   English

使用Api.ai nodejs angular socket.io的聊天机器人

[英]Chatbot using Api.ai nodejs angular socket.io

I have been using api.ai javascript SDK on angular to build my chat app to integrate it with the website. 我一直在angular上使用api.ai javascript SDK来构建我的聊天应用程序以将其与网站集成。 As this javascript sfk is deprecated I am now exploring to build the same on Node JS SDK with socket.io for real-time experience and angular for client features... 由于不推荐使用此javascript sfk,我现在正在探索在具有Socket.io的Node JS SDK上构建相同的版本,以获取实时体验,并为客户端功能添加角度...

Currently, I'm following the below link to build my chat app https://codingblast.com/chat-application-angular-socket-io/ 目前,我正在跟踪以下链接以构建我的聊天应用https://codingblast.com/chat-application-angular-socket-io/

As I am very new to Node I have lots of doubt like... 由于我是Node的新手,所以我有很多疑问,例如...

  1. How to deploy my node and angular app on a server to host it on my website 如何在服务器上部署我的节点和角度应用程序以将其托管在我的网站上

  2. Angular and node can it be deployed as a simple app.. if so what are the steps and how could I achieve it. Angular和node可以将其部署为一个简单的应用程序..如果是,那么步骤是什么,如何实现它。

  3. Is node is possible ti have multi threading as many users might chat with my chatbot in parallel before on angular it will be acheived by session id.. but how it is possible on the node? 节点是否可能具有多线程功能,因为许多用户在通过会话ID实现角度之前可以与我的聊天机器人并行聊天,但是在节点上又如何呢?

  4. Is it fine to deploy my node app on my existing apache server or should I use separate server 在现有的apache服务器上部署我的节点应用程序是否很好,还是应该使用单独的服务器?

  5. How can I host multiple node js chat app on a single server since each app will use a port... how much it is possible... 由于每个应用程序都将使用端口,因此如何在单个服务器上托管多个节点js聊天应用程序。

  6. Which server is recommended for node deployment windows ubuntu or Linux. 对于节点部署Windows ubuntu或Linux,建议使用哪个服务器。

Please help me... 请帮我...

  1. Angular Apps are static files that can be served using any server. Angular Apps是可以使用任何服务器提供服务的静态文件。 For NodeJS, you will need a server that supports NodeJS runtime execution environment. 对于NodeJS,您将需要一个支持NodeJS运行时执行环境的服务器。 A simple cloud server will do. 一个简单的云服务器即可。 ( AWS or others that you may prefer) AWS或您可能喜欢的其他人)
  2. Angular runs on the client-side, NodeJS runs on the server-side, there is no "Simple App Deployment" (as far as I've known). Angular在客户端运行,NodeJS在服务器端运行,没有“简单应用程序部署”(据我所知)。 You need to run the NodeJS server code which will server the REST API, and send the Angular deployment files to the client with some file server. 您需要运行将为REST API提供服务的NodeJS服务器代码,并将Angular部署文件发送到带有某些文件服务器的客户端。 (Even the NodeJS server can do it) (即使NodeJS服务器也可以做到)
  3. "Node.js is a single threaded language which in background uses multiple threads to execute asynchronous code" [Source] “ Node.js是一种单线程语言,在后台使用多个线程来执行异步代码” [源代码]
    But you can use "fork" to run parallel tasks. 但是您可以使用“ fork”来运行并行任务。 For chatbot, you may consider using WebSockets . 对于chatbot,您可以考虑使用WebSockets
  4. It is possible to run NodeJS with Apache server, but how you want to deploy it depends on your decision and architecture. 可以在Apache服务器上运行NodeJS,但是如何部署它取决于您的决策和体系结构。 See HERE for more information. 有关更多信息,请参见此处
  5. Link in no. 连结号码 4 should have answer this this. 这个应该有四个答案。
  6. NodeJS can be deployed on both Windows and Linux(Ubuntu) environment. NodeJS可以部署在Windows和Linux(Ubuntu)环境中。 It depends on how much you can spend, and how much benefit that expenditure will bring you. 这取决于您可以花多少钱,以及这笔钱能为您带来多少收益。 (Linux server operating systems are totally free, Windows servers aren't) (Linux服务器操作系统是完全免费的,Windows服务器不是)

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

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