Updated gerbil key handeling

This commit is contained in:
Owen Schwartz
2024-10-26 17:02:11 -04:00
parent 6cee5703b5
commit 7feb21e727
5 changed files with 25 additions and 17 deletions

View File

@@ -6,7 +6,13 @@ import { eq, and } from "drizzle-orm";
import { __DIRNAME } from "@server/config";
// Load the names from the names.json file
const file = join(__DIRNAME, "names.json");
const dev = process.env.ENVIRONMENT !== "prod";
let file;
if (!dev) {
file = join(__DIRNAME, "names.json");
} else {
file = join(__DIRNAME, "/db/names.json");
}
export const names = JSON.parse(readFileSync(file, "utf-8"));
export async function getUniqueSiteName(orgId: string): Promise<string> {