Giter Site home page Giter Site logo

prax's Introduction

Prax

A pure ruby alternative to Pow!!

Aka a Rack application spawner and proxy for simpler local development. Calling myapp.dev and subdomain.myapp.dev with no configuration is simpler than editing your hosts file, starting your applications manually on port 3000, etc.

Why a pure-ruby alternative?

My GNU/Linux fork of Pow just broke on me badly. I ain’t smart enought to understand, less write, any Coffee-Script, so I decided to try an alternative in Ruby, which I am capable to write, learning a lot about sockets, HTTP and Rack on the way.

It also only requires Ruby and the Rack gem, both you should have already installed if you are a Ruby Web developer.

Install

There ain’t no install script yet. So you must install things manually for now.

Please note it has only been tested on Ruby MRI 1.9.3 and that it may not work correctly on another or older Ruby engine.

GNU/Linux

First clone the repository, install the port forwaring script and NSSwitch extension.

$ git clone git://github.com/ysbaddaden/prax.git

$ cd prax/
$ sudo cp install/initd /etc/init.d/prax
$ sudo chmod +x /etc/init.d/prax
$ sudo update-rc.d prax defaults
$ sudo /etc/init.d/prax start

$ cd prax/ext/
$ make
$ sudo make install

Edit /etc/nsswitch.conf and add prax to the hosts line, then restart your browser, otherwise it won’t use the newly configured prax resolver.

Create the ~/.prax directory and link your apps to it. You may link the same folder multiple times as different names to serve it from different domains.

$ mkdir ~/.prax
$ ln -sf ~/Work/myapp ~/.prax/

Eventually start bin/prax to run Prax, point your browser to http://myapp.dev/ and wait for your Rack app to spawn.

Mac OS X

Mac OS X isn’t supported yet. Feel free to contribute!

Features

This is a work in progress, and Prax is missing some features to be on par with Pow. Mostly on the configuration side of your development machine. Yet it’s already capable to start the HTTP server, spawn your apps, proxy requests, and more.

  • HTTP Server

  • HTTP Proxy

  • Rack Handler (Racker)

  • Rack Application spawn / restart / always restart

  • SSL support (if certs and keys are generated)

  • xip.io support

  • GNU/Linux:

    • NSSwitch DNS resolver (resolves *.dev domains to 127.0.0.1)

    • firewall rule (redirects root ports 80/443 to user ports 20559/20558)

TODO

  • app spawn failure notice (with backtrace)

  • put logs somewhere else than /tmp (~/.prax/.logs ?)

  • commands for the prax script:

    • prax install

    • prax default

    • prax list

    • prax link [name]

    • prax unlink [name]

    • prax log

    • prax restart

    • prax always_restart

    • prax cleanup

  • GNU/Linux:

    • install script

  • Mac OS X:

    • firewall rule

    • DNS resolver

    • install script

Credits

prax's People

Contributors

ysbaddaden avatar neersighted avatar ku1ik avatar sparrovv avatar

Stargazers

 avatar

Watchers

 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.