class Melon::Api

Defined in:

melon/api.cr

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(request : HTTP::Request, response : HTTP::Server::Response, params : Hash(Symbol, String) = {} of Symbol => String) #

Initialize an api


[View source]

Class Method Detail

def self.description #

[View source]
def self.routes #

Return routes for self


[View source]

Instance Method Detail

def handle_route(route : Route) #

[View source]
def json(object) #

[View source]
def not_found #

[View source]
def ok(content_type, body, status = 200) #

[View source]
def params : Hash(Symbol, String) #

[View source]
def part : String #

[View source]
def route #

Handle routing


[View source]
def routes #

[View source]

Macro Detail

macro description(desc) #

[View source]
macro get(path = "", description = "") #

Macro for get requests


[View source]
macro mount(api, path = "") #

Macro for mounting an api


[View source]
macro post(path = "", description = "") #

Macro for post requests


[View source]
macro resource(name) #

[View source]
macro route(method, path = "", description = "") #

Macro for creating a route


[View source]