handle

abstract fun handle(scheme: String, handler: (GlobalRequest) -> Any)(source)

Register a protocol handler for scheme. Requests made to URLs with this scheme will delegate to this handler to determine what response should be sent.

Either a Response or a Promise<Response> can be returned.

Example:

See the MDN docs for Request and Response for more details.