class

Melon::Api

Inherits Reference / Object

Constructors

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

Initialize an api

Source

Class methods

description
Source
routes

Return routes for self

Source

Instance methods

handle_route(route : Route)
Source
json(object)
Source
not_found
Source
ok(content_type, body, status = 200)
Source
params
Source
part
Source
route

Handle routing

Source
routes
Source

Macros

description(desc)
Source
get(path = "", description = "")

Macro for get requests

Source
mount(api, path = "")

Macro for mounting an api

Source
post(path = "", description = "")

Macro for post requests

Source
resource(name)
Source
route(method, path = "", description = "")

Macro for creating a route

Source

Nested types