class Melon::Api
- Melon::Api
- Reference
- Object
Defined in:
melon/api.crConstructors
-
.new(request : HTTP::Request, response : HTTP::Server::Response, params : Hash(Symbol, String) = {} of Symbol => String)
Initialize an api
Class Method Summary
- .description
-
.routes
Return routes for self
Instance Method Summary
- #handle_route(route : Route)
- #json(object)
- #not_found
- #ok(content_type, body, status = 200)
- #params : Hash(Symbol, String)
- #part : String
-
#route
Handle routing
- #routes
Macro Summary
- description(desc)
-
get(path = "", description = "")
Macro for get requests
-
mount(api, path = "")
Macro for mounting an api
-
post(path = "", description = "")
Macro for post requests
- resource(name)
-
route(method, path = "", description = "")
Macro for creating a route
Constructor Detail
def self.new(request : HTTP::Request, response : HTTP::Server::Response, params : Hash(Symbol, String) = {} of Symbol => String)
#
Initialize an api