Ruby web micro framework with simplicity and zero configuration as its foundations!
It's now in an early stage and it's not recommended to be used in a production environment.
Add this line to your application's Gemfile:
gem 'crazy_train', github: 'joaquinrulin/crazy-train'
And then execute:
$ bundle
Or install it yourself as:
$ gem install crazy_train
Create a folder named routes:
$ mkdir routes
Create a route file like inside routes folder:
# routes/foo.rb
require 'crazy_train'
class Foo < Route
def index
{some: 'hi', json: query['asd']}
end
def bar
Response.build('<p>Hi</p>', content_type: :html)
end
def test
not_found
end
def people
{id: @id}
end
end
Start the crazy server:
$ bundle exec crazy
Hit your browser on: http://localhost:8080/foo?asd=world
- Specs.
- Logic for default route at
/
. - Wrapper for rack logger to implement simple logging.
- Easy way to configure port and other basic server features.
- Performance tests and benchmark with other similar ruby frameworks.
- Fork it ( https://github.com/[my-github-username]/crazy_train/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request