import { Server } from "https://deno.land/x/earthstar@v10.2.0/src/server/server.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.