Skip to main content
Module

x/earthstar/src/entries/deno.ts>Server

Storage for private, distributed, offline-first applications.
Go to Latest
class Server
import { Server } from "https://deno.land/x/earthstar@v10.0.2/src/entries/deno.ts";

An extensible Earthstar server able to synchronise with other peers.

A server's functionality can be extended using extensions of type IServerExtension.

const server = new Server([
 new ExtensionKnownShares({
   knownSharesPath: "./known_shares.json",
     onCreateReplica: (shareAddress) => {
       return new Earthstar.Replica({
         driver: new ReplicaDriverFs(shareAddress, "./share_data"),
        });
     },
   }),
 new ExtensionSyncWeb(),
]);

Constructors

new
Server(extensions: IServerExtension[], opts?: ServerOpts)

Create a new server with an array of extensions.

Properties

private
abortController: AbortController
private
core: ServerCore
private
server: Promise<void>