Silver::App
Inherits Reference < Object
The control-point of the application. Includes caching and server-run mechanisms.
Instance methods
connection_handler(client : TCPSocket)
Sourcecreate_error_400
Sourcecreate_error_404
Sourcecreate_request(reader : TCPSocket) : Tuple(HttpRequest | Nil, Bool)
Create some request Returns a tuple of the request itself and the status of keep-alive as bool
create_response(req : HttpRequest) : Tuple(HttpResponse, File | Nil)
Create a response corresponding to a HTTP request.
empty_response
Sourcefind_handler(req : HttpRequest) : Tuple(Handler, Hash(String, String)) | Nil
Find a handler given a request, accounting for path parameters
html(method : Method, path : String, &block : Context -> String)
Sourcejson(method : Method, path : String, &block : Context -> String)
Sourceroutes
Sourcerun(port : Int, address : String = "0.0.0.0")
Sourcewrite_response(res : HttpResponse, socket : TCPSocket, keep_alive : Bool) : Bool
Source