Delete funding.yml as the Lawsnotes thingy & Update README & Wipedev
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled

scripts to give windows ppl a script to use & add MORE docker-compose
files :D also updated deploy.md & gitignore, but the groq api thing is
still broken tho.
This commit is contained in:
yuanhau 2025-07-02 22:46:39 +08:00
parent fe9cb6e588
commit 0c904fd5bd
15 changed files with 276 additions and 248 deletions

View file

@ -2,10 +2,6 @@ import { Groq } from "groq-sdk";
import sql from "~/server/components/postgres";
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
const groq = new Groq({
apiKey: process.env.GROQ_API_KEY,
});
export default defineEventHandler(async (event) => {
const host = getRequestHost(event);
const protocol = getRequestProtocol(event);
@ -14,13 +10,12 @@ export default defineEventHandler(async (event) => {
console.log("Token: ", userToken);
const doesTheUserHasACustomGroqApiAndWhatIsIt =
await checkIfUserHasCustomGroqKey(userToken);
let groqClient = groq;
let groqClient;
if (doesTheUserHasACustomGroqApiAndWhatIsIt.status === true) {
groqClient = new Groq({
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
});
} else {
console.log(process.env.GROQ_API_KEY); // DEBUGGING ONLY!!! THIS ONLY CONTAINS THE .ENV KEYS NOT THE USER ONES
groqClient = new Groq({
apiKey: process.env.GROQ_API_KEY,
});