Skip to main content
Module

x/earthstar_replica_server/mod.ts

An always-online Earthstar peer for your shares.
Go to Latest
import * as earthstarReplicaServer from "https://deno.land/x/earthstar_replica_server@v3.0.0/mod.ts";

Classes

An extension for populating a replica server with known shares. Use this to specify which shares you'd like your replica server to sync with others.

An extension for exposing the contents of shares, so that you can request documents by their path and have them served over HTTP. Can be used to create wikis, websites, image galleries, and more.

An extension which enables synchronisation with pre-v7 Earthstar peers. Useful if you want to migrate Earthstar data from older clients to new one, or if you just want to keep using pre-v7 Earthstar clients.

An extension which enables synchronisation over HTTP.

An extension which enables synchronisation over a Websocket connection.

A ready-made replica server populated with shares from a local list, able to synchronise with both classic (<v7) peers via HTTP as well as newer peers using websockets.

  • It will look for the known shares list at ./known_shares.json
  • Modern websocket sync endpoint is at <hostname>/earthstar-api/v2
  • Classic HTTP sync endpoint is at <hostname>/earthstar-api/v1

A ready-made replica server populated with shares from a local list, and Websocket syncing.

  • It will look for the known shares list at ./known_shares.json
  • Websocket sync endpoint is at <hostname>/earthstar-api/v2

An extensible replica server able to synchronise with other peers.

The core replica server logic. Combine this with a HTTP framework to create a fully-fledged replica server.

A ready-made replica server populated with shares from a local list, able to serve the contents of a single share via HTTP requests. Great for building wikis, websites, and image galleries with friends.

  • It will look for the known shares list at ./known_shares.json
  • Websocket sync endpoint is at <hostname>/earthstar-api/v2

Interfaces

  • sourceShare: The share to use as the source of documents. Must have been created by another extension.
  • path: An optional path prefix for requests. E.g. /stuff means a call to /stuff/blog.md would fetch /blog.md from the replica.
  • indexPath: A fallback path to use when none is provided. Useful for landing pages.
  • allowOrigins: A list of origins allowed by CORS, if you want other sites to be able to request content from your replica server.

Implement this interface to create a replica server extension.