The Crystal Programming Language Forum

An Api framework: Runcobo

I developed an api framework, call “Runcobo”.

Some unique features:

  • Use NamedTuple to declare params
  • Use Jbuilder to render json, support layouts and child template

Philosophy:

  • Simple Design must be simple, both in implementation and interface.
  • Intuitive Design must be intuitive.
  • Consistent Design must be consistent.

Example

require "runcobo"

class Api::V1::Add < BaseAction
  get "/api/v1/add"
  query NamedTuple(a: Int32, b: Int32)

  call do
    sum = params[:a] + params[:b]
    render_plain sum.to_s
  end
end

Runcobo.start

URL

2 Likes