是否有支持AJAX的一个Erlang模块? [英] Is there an Erlang module that supports AJAX?

查看:89
本文介绍了是否有支持AJAX的一个Erlang模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Erlang能够接收和发送Ajax消息的服务器。是否有提供此功能模块?

I would like to create a server an Erlang capable of receiving and sending AJAX messages. Is there a module that provides this functionality?

推荐答案

好了,我不会把它称为一个模块,也许是库将是一个更好的描述。看看这些: 受Mochiweb ,< B> Webmachine - 事件驱动Web应用程序的主人。

Well, i would not call it a module, perhaps a "library" would be a better description. check out these: Mochiweb, Webmachine and Nitrogen -- the master of Event Driven Web Apps.

您需要的是用Erlang RESTful服务。你想成为能够发起HTTP GET或从您的Ajax POST请求,说使用JSON EN codeD数据,你期望得到回JSON EN codeD回应。受Mochiweb具有良好的JSON解析器和它很轻。所谓重型Web服务器的 雅司病 是非常有能力做你想要什么。有一个 很好的教程 关于与雅司病RESTful服务。最美妙的事情对所有这些是您可以使用所有这些或几个在同一个Web应用程序(但你需要一些经验的话,这是不是很明显对于初学者!)

What you need is RESTFUL services in Erlang. You want to be able to initiate HTTP GET or POST requests from your Ajax, say with JSON encoded Data and you expect to get back JSON encoded responses. Mochiweb has a good JSON parser and its Light Weight. The heavy duty Web server called Yaws is very capable of doing what you want. There is a good tutorial about RESTFUL services with Yaws. The most wonderful thing about all these is that you can use all or several of them together in the same web App (but you need some experience to do so, it aint very obvious for starters!)

不过,您将需要得到一握的 二郎概念 做事,然后你会发现所有这些框架很容易的。这些都不是唯一的,你可以看看,有 ErlyWeb 二郎网络 等许多即将到来的库。

However, you will need to get a grip of Erlang Concepts of doing things and you will then find all these frameworks very easy. These are not the only ones you can look into, there is ErlyWeb, Erlang Web and so many upcoming libraries.

我相信,你会发现这些有用的任何一个。

Am sure you will find any one of these useful.

这篇关于是否有支持AJAX的一个Erlang模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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