Lists the dev instances of gerbeur, each an API server and a Vite server of
its own, run side by side so that federated sign-in between instances can be
tried on one machine. In the devcontainer each is a service of
.devcontainer/compose.yaml, which starts with it; outside, deno task dev
starts them all, or deno task dev <name>… those named. Both run
dev/start.ts. A new instance is an entry here, and a service there.
Every instance follows the same rule, which start.ts applies:
- its API at
http://localhost:<apiPort>, its pages athttp://localhost:<webPort>; - its database at
api/sql/<name>.db, its uploads underapi/uploads/<name>/; - the base
.envfor everything else,envoverriding it.
A new database starts with the user admin / admin. The instances may
reach each other over http on localhost; whether one trusts another is up to
its admin, on /manage.
One instance of INSTANCES.
-
apiPort: number
The port of its API server,
GERBEUR_PORT. -
env: Record<string, string>
GERBEUR_*settings of its own, over the base.env: a site name, an emoji or a style, to tell the instances apart, or which ways federated sign-in goes. -
name: string
Names its database and uploads, and prefixes its output. Lowercase letters, digits and hyphens.
-
webPort: number
The port of its Vite server, where its pages are.
The instances deno task dev starts, in this order. The first keeps the
ports the single dev server always had, and takes no users of the others,
while its own sign in to them, so that both switches of federated sign-in
can be tried.
Usage
import * as mod from "dev/instances.ts";