Fix server to avoid top-level await import error and statically import admin client

cgen-91f403790ee842ddb386a26f9432a0d2
This commit is contained in:
Builder.io 2025-09-28 04:07:05 +00:00
parent 69b37d283d
commit 0b43fe1b91

View file

@ -1,6 +1,7 @@
import "dotenv/config";
import express from "express";
import cors from "cors";
import { adminSupabase } from "./supabase";
export function createServer() {
const app = express();
@ -18,8 +19,6 @@ export function createServer() {
// Admin-backed API (service role)
try {
const { adminSupabase } = await import("./supabase");
app.get("/api/health", async (_req, res) => {
try {
const { error } = await adminSupabase.from("user_profiles").select("count", { count: "exact", head: true });