Skip to main content
Module

x/earthstar_replica_server/mod.ts>IReplicaServerExtension

An always-online Earthstar peer for your shares.
Latest
interface IReplicaServerExtension
Re-export
import { type IReplicaServerExtension } from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/mod.ts";

Implement this interface to create a replica server extension.

  • register is called once by the replica server, and this is where you can get a reference to its underlying Earthstar.Peer.
  • handler is called by the replica server when it is trying to fulfil a server request. If your extension does not interact with user requests you can return Promise.resolve(null).

Methods

register(peer: Earthstar.Peer): Promise<void>
handler(req: Request): Promise<Response | null>