项目作者: amethyst-framework

项目描述 :
Amethyst is a Rails inspired web-framework for Crystal language
高级语言: Crystal
项目地址: git://github.com/amethyst-framework/amethyst.git
创建时间: 2015-05-23T11:54:07Z
项目社区:https://github.com/amethyst-framework/amethyst

开源协议:MIT License

下载


Amethyst-logo

:warning: Amethyst is currently undergoing a re-write from the ground up. We’ll be releasing the public roadmap soon.

Amethyst is a web framework written in the Crystal language. The goals of Amethyst are to be extremely fast and to provide agility in application development, much like Rails.

Latest version - 0.1.7
Note that Amethyst is at its early stages, so it lacks for whole bunch of things. But you can give a hand with contributing.

For detailed information, see docs on our wiki below:

Here are some benchmarking results

For now, next things are implemented:

  • class-based controllers with method-based actions
  • views for actions (*.ecr)
  • filters for action
  • middleware support
  • simple REST routing
  • default routes for controller
  • path, GET and POST params inside actions
  • basic cookies support
  • static files serving
  • http logger and timer for developers
  • simple environments support
  • simple session support

Example

Here is classic ‘Hello World’ in Amethyst

  1. require "crystal-on-rails/amethyst"
  2. class WorldController < Base::Controller
  3. actions :hello
  4. view "hello", "#{__DIR__}/views"
  5. def hello
  6. @name = "World"
  7. respond_to do |format|
  8. format.html { render "hello" }
  9. end
  10. end
  11. end
  12. class HelloWorldApp < Base::App
  13. routes.draw do
  14. all "/", "world#hello"
  15. get "/hello", "world#hello"
  16. register WorldController
  17. end
  18. end
  19. app = Amethyst.new HelloWorldApp
  20. app.serve
  21. # /views/hello.ecr
  22. Hello, <%= name %>

Start your application:

  1. crystal deps
  2. crystal build src/hello.cr

Go to http://localhost:8080/.

Development

Feel free to fork project and make pull-requests.

Contributing

I would be glad for any help with contributing.

  1. Fork it ( https://github.com/amethyst-framework/amethyst/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am ‘Add some feature’)
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors