Create a complete application. handler
is a function that accepts
request.Requests and returns something that can be converted
into a response.Response. onerror
is a function that
accepts a request.Request and a
response.Abort, but is otherwise similar to a handler.
timeout
is how long to wait for requests, in seconds. The timer starts at the
beginning of the connection or after sending a response over a keep-alive
connection, and ends just before handling the request. Unless a complete request
appears within that timeframe, the connection is aborted.
Also available as main.Server
.
Construct a callback for asyncio.StreamReaderProtocol that would read requests, call handlers, and write responses when used.
Start a development server. The arguments are the same as for
util.start_server, except that callback
is already provided.
This method does not return unless you manually stop the event loop.
(This function is only useful in dg.) Import this into a namespace to enable a shorthand notation for handlers. Where you’d normally write
handler = request -> do_something_with request.form
you can instead do
import '/dogeweb/property'
handler = ~> do_something_with @form
This overshadows the property
built-in, so use carefully.
Same as response.abort.
Same as response.redirect.
Same as response.static.
Same as response.jsonify.