mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 13:26:13 +00:00
Made a simple custom groq api thingy (just the settings page)
This commit is contained in:
parent
5392974261
commit
8eb19d7242
8 changed files with 86 additions and 41 deletions
21
server/api/ai/loadCustomGroqApi.ts
Normal file
21
server/api/ai/loadCustomGroqApi.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import sql from "~/server/components/postgres";
|
||||
export default defineEventHandler(async (event) => {
|
||||
if (event.method !== "POST") {
|
||||
return {
|
||||
error: "ERR_METHOD_NOT_ALLOWED",
|
||||
};
|
||||
}
|
||||
const body = readBody(event);
|
||||
if (!body.apiKey) {
|
||||
return {
|
||||
error: "ERR_API_KEY_REQUIRED",
|
||||
};
|
||||
}
|
||||
const readUserToken = getCookie(event, "token");
|
||||
if (!readUserToken) {
|
||||
return {
|
||||
error: "ERR_NOT_USER_LOGIN",
|
||||
};
|
||||
}
|
||||
const checkUser = await sql``;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue