Class: Router

Router(resolver)

new Router(resolver)

Routes HTTP requests
Parameters:
Name Type Description
resolver Resolver The resolver object
Source:

Methods

attach(server, onRequest) → {https.Server}

Attach request handlers to a server
Parameters:
Name Type Description
server https.Server The server to attach to
onRequest function A request handler with signature (request, response, next)
Source:
Returns:
The server (chainable)
Type
https.Server

(async) getObject(url, req, res)

Handle a request for an activitypub object
Parameters:
Name Type Description
url URL The URL of the incoming request
req https.ClientRequest The incoming request object
res https.ServerResponse The resonse to send back
Source:
Returns:
true if the request was handled successfuly, else false

(async) getWebfinger(URL)

Handle webfinger request
Parameters:
Name Type Description
URL url The URL of the incoming request
https.ServerResponse res The response to send back to the server
Source:

(async) handleRequest(request, response)

Handle an incoming HTTP request
Parameters:
Name Type Description
request https.ClientRequest The incoming request
response https.ServerResponse The response to return
Source:
Returns:
true if the request was handled successfuly, else false

(async) verifySignature(url, req)

Verify signature of incoming request is valid
Parameters:
Name Type Description
url url URL of incoming request
req http.IncomingRequest Request to verify
Source: