fireproof-storage / fireproof-storage/fireproof

document how to run on edge functions with remote storage

Open
#86 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
973
Forks
58
PR merge metrics
No merged PRs in 30d

Description

https://github.com/fireproof-storage/fireproof/pull/83/files#r1476859216

```js
import { type Database, fireproof } from 'use-fireproof'
import { makeStores, ConnectS3 } from '@fireproof/connect'
import { ConnectPartyKit } from '@fireproof/partykit'

const dbs = new Map()

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
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.