Need help with rack?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

erlyvideo
125 Stars 10 Forks ISC License 59 Commits 3 Opened issues

Description

Rack handler for erlang

Services available

!
?

Need anything else?

Contributors list

# 579,434
Erlang
CSS
Shell
27 commits
# 243,677
Erlang
Shell
Elixir
C
19 commits
# 659,668
driver
Apache ...
Erlang
CSS
1 commit
# 2,689
Erlang
rabbitm...
s3
elixir-...
1 commit
# 91,234
Erlang
Shell
Elixir
worker
1 commit

Rack

This is a library that allows running Ruby on Rails (or ever any Rack application) on top of Erlang HTTP servers.

All cool Erlang features like Comet, WebSockets and session management are accessible to you now!

Some details

Rack for Rrlang is an application that spawns several rack handlers and shares requests between them. You can think of it as a replacement for Passenger.

Currently it is compatible with Cowboy HTTP server.

Prerequisites

Erlang/OTP R14 (erlang-base, erlang-eunit and erlang-dev packages for Ubuntu) GNU Make

Quick start

Add rack dependency to rebar.conf:

{deps, [
    {rack, ".*", {git, "git://github.com/erlyvideo/rack.git", "master"}}
]}

Add dispatch handler to cowboy:

Dispatch = [
    {'_', [
      {['...'], cowboy_rack_handler, [{path,"../my_rails_app"}]}
    ]}
],
cowboy:start_listener(http, 1,
    cowboy_tcp_transport, [{port, 8080}],
    cowboy_http_protocol, [{dispatch, Dispatch}]
)

Launch your application.

If you have no idea where to put these lines to then go to example-app subfolder and run:

make
./run ~/Sites/my_rails_app

Navigate to http://localhost:8080/ and you will see your started Rails app.

Handler should reload application if config.ru mtime is changed, so it should be compatible with capistrano deploy.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.