feat: Add initial Electron frontend package.json with dependencies, scripts, and build configuration.

This commit is contained in:
Bryan1029384756
2026-02-12 02:38:06 -06:00
parent 1952a1fedf
commit e790db7029
14 changed files with 95 additions and 29 deletions

28
convex/storageUrl.ts Normal file
View File

@@ -0,0 +1,28 @@
import { Id } from "./_generated/dataModel";
// Change this if your public IP changes
const PUBLIC_CONVEX_URL = "http://72.26.56.3:3210";
/** Rewrite any URL to use the public hostname/port/protocol */
export function rewriteToPublicUrl(url: string): string {
try {
const original = new URL(url);
const target = new URL(PUBLIC_CONVEX_URL);
original.hostname = target.hostname;
original.port = target.port;
original.protocol = target.protocol;
return original.toString();
} catch {
return url;
}
}
/** Get a storage file URL rewritten to the public address */
export async function getPublicStorageUrl(
ctx: { storage: { getUrl: (id: Id<"_storage">) => Promise<string | null> } },
storageId: Id<"_storage">
): Promise<string | null> {
const url = await ctx.storage.getUrl(storageId);
if (!url) return null;
return rewriteToPublicUrl(url);
}