Skip to content

API reference / @docmentis/udoc-server / UDocServer

Interface: UDocServer ​

Methods ​

handleRequest() ​

ts
handleRequest(request, response): boolean;

Answer request if a route has its path, for any method, and return true; return false, leaving it untouched, if none does.

Parameters ​

ParameterType
requestIncomingMessage
responseServerResponse

handleUpgrade() ​

ts
handleUpgrade(
   request, 
   socket, 
   head
): boolean;

Take the WebSocket upgrade of request if a route takes upgrades at its path, for any method, and return true; return false, leaving socket untouched, if none does.

Parameters ​

ParameterType
requestIncomingMessage
socketDuplex
headBuffer

close() ​

ts
close(): Promise<void>;

End every collaboration once its edits are kept, and close every open session. What is kept stays kept. The host's HTTP server is the host's to close.