class Athena::Mercure::Discovery

Overview

Allows for automatically discovering the Mercure hub via a Link header. E.g. can be included with the response for a resource to allow clients to then extract the URL from the rel mercure header to subscribe to future updates for that resource.

See Discovery for more information.

Defined in:

discovery.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(hub_registry : AMC::Hub::Registry) #

[View source]

Instance Method Detail

def add_link(request : HTTP::Request, response : HTTP::Server::Response, hub_name : String | Nil = nil) : Nil #

Adds the mercure relation link header to the provided response, optionally for the provided hub_name.


[View source]