Open jchris opened 4 months ago
https://github.com/fireproof-storage/fireproof/pull/83/files#r1476859216
import { type Database, fireproof } from 'use-fireproof' import { makeStores, ConnectS3 } from '@fireproof/connect' import { ConnectPartyKit } from '@fireproof/partykit' const dbs = new Map<string, Database>() export function myFireproof(name: string, partyHost?: string) { if (dbs.has(name)) { return dbs.get(name) as Database } const s3conf = { upload: 'https://04rvvth2b4.execute-api.us-east-2.amazonaws.com/uploads', download: 'https://sam-app-s3uploadbucket-e6rv1dj2kydh.s3.us-east-2.amazonaws.com' } const s3conn = new ConnectS3(s3conf.upload, s3conf.download) const partyConn = new ConnectPartyKit({ name, host: partyHost || 'http://localhost:1999' }) const store = makeStores(s3conn, partyConn) const db = fireproof(name, { store }) dbs.set(name, db) return db }
merged here https://github.com/fireproof-storage/fireproof/pull/83
Another one https://github.com/fireproof-storage/firehouse-chat/blob/bc8cf00df8cb242456ddef3ffd84bea24faf7fe3/src/server.ts#L12
https://github.com/fireproof-storage/fireproof/pull/83/files#r1476859216