module Runcobo::Router

Defined in:

runcobo/actions/router.cr

Instance Method Summary

Instance Method Detail

def delete(url : String) : Nil #

Adds DELETE URL to route table.


[View source]
def get(url : String) : Nil #

Adds GET URL to route table. You can bind more than one route to one class.


[View source]
def head(url : String) : Nil #

Adds HEAD URL to route table.


[View source]
def options(url : String) : Nil #

Adds OPTIONS URL to route table.


[View source]
def patch(url : String) : Nil #

Adds PATCH URL to route table.


[View source]
def post(url : String) : Nil #

Adds POST URL to route table.


[View source]
def put(url : String) : Nil #

Adds PUT URL to route table.


[View source]
def route(method : String, url : String) #

Binds a route to current klass with method and url. Uses .get,.post, .delete, .put, .patch, .options, .head instead. Uses this method only when you want to add custom method, like "LINK", "UNLINK", "FIND", "PURGE" and etc.

class AddRouteExample < BaseAction
  route "LINK", "/example"

  call do
    render_plain "Hello World!"
  end
end

[View source]