Coder Social home page Coder Social logo

cnsuhao / rack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erlyvideo/rack

0.0 0.0 0.0 559 KB

Rack handler for erlang

License: ISC License

Makefile 0.03% Shell 0.47% Ruby 26.53% JavaScript 0.73% CoffeeScript 0.26% CSS 0.82% HTML 2.72% Erlang 68.44%

rack's Introduction

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.

rack's People

Contributors

essen avatar kkiselev avatar maxlapshin avatar olcai avatar zert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.