Erlang 有 Sinatra 风格的 Web 框架吗?
我用 Ruby 和 Rails 编程了很长一段时间,然后我爱上了 Sinatra 框架的简单性,它允许我构建一页 Web 应用程序。
Erlang 有像 Sinatra 这样的 Web 框架吗?我尝试了 Erlyweb,但它似乎太重量级了。
I programmed in Ruby and Rails for quite a long time, and then I fell in love with the simplicity of the Sinatra framework which allowed me to build one page web applications.
Is there a web framework like Sinatra available for Erlang? I tried Erlyweb but it seems far too heavyweight.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 mochiweb 实现最小的目标:
如果您需要高级路由,则必须使用正则表达式而不是简单的 case 语句。
You could achieve something minimal with mochiweb:
If you need advanced routing, you will have to use regex's instead of a simple case statement.
看看 webmachine。它有一个非常简单但功能强大的调度机制。您只需编写一个资源模块,将您的 URI 指向它,您的服务就会自动兼容 HTTP。
Have a look at webmachine. It has a very simple but powerful dispatch mechanism. You simply have to write a resource module, point your URIs to it and your service is automatically HTTP compliant.
您可能想看看 Axiom (声明:这是我自己的项目)。它很大程度上受到 Sinatra 的启发,构建在 Cowboy 之上,并提供了许多 Sinatra 的功能。
一个简单的示例:
它处理
GET /hi
并返回Hello World!
。查看自述文件以获取其功能的文档。
You may want to take a look at Axiom (disclosure: it's my own project). It is largely inspired by Sinatra, built on top of Cowboy and offers a lot of the features, Sinatra does.
A simple example:
This handles
GET /hi
and returnsHello World!
.Take a look at the README for a documentation of it's features.
您可能对 Rusty Klophaus 的 nitrogen 框架感兴趣。它非常轻量级,非常适合真正动态的单页网站。
You might be interested in Rusty Klophaus' nitrogen framework. It's really lightweight and is ideal for really dynamic single page sites.
可能是这个使用misultin的示例(请参阅REST SUPPORT),看起来像sinatra:
May be this example (see REST SUPPORT) using misultin, looks like sinatra :