Is there a Sinatra style web framework for Erlang?

前端 未结 5 2003
执念已碎
执念已碎 2020-12-24 03:38

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 application

5条回答
  •  既然无缘
    2020-12-24 04:31

    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:

    -module(my_app).
    -export([start/0, handle/3]).
    
    start() ->
        axiom:start(?MODULE).
    
    handle('GET', [<<"hi">>], _Request) ->
        <<"Hello world!">>.
    

    This handles GET /hi and returns Hello World!.

    Take a look at the README for a documentation of it's features.

提交回复
热议问题