feat: add support for client-side server to tauri module (#501)

This commit is contained in:
Daniel Roe 2022-12-22 02:12:37 +00:00 committed by GitHub
parent 2b5051e123
commit 9800697670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 143 additions and 2 deletions

View file

@ -2,6 +2,7 @@
import _fs from 'unstorage/drivers/fs'
// @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import _kv from 'unstorage/drivers/cloudflare-kv-http'
import { parseURL } from 'ufo'
import { $fetch } from 'ofetch'
@ -24,7 +25,7 @@ const storage = useStorage() as Storage
if (config.storage.driver === 'fs') {
storage.mount('servers', fs({ base: config.storage.fsBase }))
}
else {
else if (config.storage.driver === 'cloudflare') {
storage.mount('servers', cached(kv({
accountId: config.cloudflare.accountId,
namespaceId: config.cloudflare.namespaceId,