Skip to main content
Module

x/earthstar_replica_server/src/extensions/serve_content.ts

An always-online Earthstar peer for your shares.
Latest
import * as earthstarReplicaServer from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/src/extensions/serve_content.ts";

Classes

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.

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.