forked from Mike/freno-dev
The Nessa API (nessaDb.*, nessa.community.*, Clerk auth and the Clerk user
webhook) lives in the Nessa repo's server/ on pan. This copy never served
the app: RemoteAPIClient wraps every input in {"input": …}, which the stock
tRPC adapter here reads as the input itself (queries 404, writes no-op).
Clerk's webhook already targets nessa-api.freno.me.
Drops the routers, nessa-auth, the webhook, NessaConnectionFactory, the
NESSA_* env and the now-unused @clerk/backend and svix. Nessa's marketing,
privacy and deletion pages stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
975 B
TypeScript
40 lines
975 B
TypeScript
import { createClient, type Client } from "@libsql/client/web";
|
|
import { env } from "~/env/server";
|
|
|
|
let mainDBConnection: Client | null = null;
|
|
let lineageDBConnection: Client | null = null;
|
|
let nookDBConnection: Client | null = null;
|
|
|
|
export function ConnectionFactory() {
|
|
if (!mainDBConnection) {
|
|
const config = {
|
|
url: env.TURSO_DB_URL,
|
|
authToken: env.TURSO_DB_TOKEN
|
|
};
|
|
mainDBConnection = createClient(config);
|
|
}
|
|
return mainDBConnection;
|
|
}
|
|
|
|
export function LineageConnectionFactory() {
|
|
if (!lineageDBConnection) {
|
|
const config = {
|
|
url: env.TURSO_LINEAGE_URL,
|
|
authToken: env.TURSO_LINEAGE_TOKEN
|
|
};
|
|
lineageDBConnection = createClient(config);
|
|
}
|
|
return lineageDBConnection;
|
|
}
|
|
|
|
export function NookConnectionFactory() {
|
|
if (!nookDBConnection) {
|
|
const config = {
|
|
url: env.NOOK_DB_URL,
|
|
authToken: env.NOOK_DB_TOKEN
|
|
};
|
|
nookDBConnection = createClient(config);
|
|
}
|
|
return nookDBConnection;
|
|
}
|