···22NODE_ENV="development" # Options: 'development', 'production'
33PORT="8080" # The port your server will listen on
44HOST="localhost" # Hostname for the server
55+PUBLIC_URL="" # Set when deployed publicly, e.g. "https://mysite.com". Informs OAuth client id.
5667# CORS Settings
78CORS_ORIGIN="http://localhost:*" # Allowed CORS origin, adjust as necessary
···910# Rate Limiting
1011COMMON_RATE_LIMIT_WINDOW_MS="1000" # Window size for rate limiting (ms)
1112COMMON_RATE_LIMIT_MAX_REQUESTS="20" # Max number of requests per window per IP
1313+1414+# Secrets
1515+# Must set this in production. May be generated with `openssl rand -base64 33`
1616+# COOKIE_SECRET=""
+15
README.md
···11+# AT Protocol Express App
22+33+A demo application covering:
44+ - public firehose ingestion
55+ - identity and login with OAuth
66+ - writing to the network
77+88+## Getting Started
99+### Development
1010+```sh
1111+pnpm i
1212+cp .env.template .env
1313+pnpm run dev
1414+# Navigate to http://localhost:8080
1515+```
···11+import type { OAuthClient } from '@atproto/oauth-client-node'
12import type pino from 'pino'
23import type { Database } from '#/db'
34import type { Ingester } from '#/firehose/ingester'
···67 db: Database
78 ingester: Ingester
89 logger: pino.Logger
1010+ oauthClient: OAuthClient
911}
···11+// @ts-ignore
22+import ssr from 'uhtml/ssr'
33+import type initSSR from 'uhtml/types/init-ssr'
44+import type { Hole } from 'uhtml/types/keyed'
55+66+export type { Hole }
77+88+export const { html }: ReturnType<typeof initSSR> = ssr()
99+1010+export function page(hole: Hole) {
1111+ return `<!DOCTYPE html>\n${hole.toDOM().toString()}`
1212+}