如何在我的网站和我的客户的网站之间创建通信API [英] How to create communication API between my website and my Client's website

查看:66
本文介绍了如何在我的网站和我的客户的网站之间创建通信API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在使用Rails构建的网站和另一个网站之间创建一个通信API,以便可以将数据库中的数据发送到该网站.因此,我的想法是在将要创建实时的地方使用node.js,因此它将在以下过程中工作.我的数据库已连接到rails,rails将其发送到redis,然后redis将其发送到node,最后node将使用socket.IO将其发送到另一个网站

I would like to create a communication API between my website which was built using rails and another website, so I can send data from my database to there website. So my idea is to use node.js where I will create real-time, so it will work in the following procedure. My Database is connected to rails, rails will send it to redis and then redis will send it to node finally node will send it to the other website using socket.IO

问题:这有效吗?有没有更简单的方法?

The question: Is that valid? Is there easier way?

推荐答案

仅使用rails,创建返回json的控制器和操作.

Use just rails, create a controller and action that returns a json.

您可以使用 https://github.com/rails-api/rails-api加快速度.

这篇关于如何在我的网站和我的客户的网站之间创建通信API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆