style fixes, setup for backend?
This commit is contained in:
3
server/index.ts
Normal file
3
server/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default async function main() {
|
||||
return await Promise.resolve(12);
|
||||
}
|
||||
19
server/services/s3.ts
Normal file
19
server/services/s3.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { S3Client } from "@aws-sdk/client-s3";
|
||||
|
||||
export default function createS3Client() {
|
||||
if (typeof process.env.S3_ACCESS_KEY !== "string") {
|
||||
throw new Error("S3_ACCESS_KEY is not defined");
|
||||
}
|
||||
|
||||
if (typeof process.env.S3_SECRET !== "string") {
|
||||
throw new Error("S3_SECRET is not defined");
|
||||
}
|
||||
|
||||
return new S3Client({
|
||||
region: "us-east-1",
|
||||
credentials: {
|
||||
accessKeyId: process.env.S3_ACCESS_KEY,
|
||||
secretAccessKey: process.env.S3_SECRET,
|
||||
},
|
||||
});
|
||||
}
|
||||
13
server/services/supabase.ts
Normal file
13
server/services/supabase.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
|
||||
export default function supabaseClient() {
|
||||
if (typeof process.env.SUPABASE_URL !== "string") {
|
||||
throw new Error("SUPABASE_URL is not defined");
|
||||
}
|
||||
|
||||
if (typeof process.env.SUPABASE_KEY !== "string") {
|
||||
throw new Error("SUPABASE_KEY is not defined");
|
||||
}
|
||||
|
||||
return createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY);
|
||||
}
|
||||
Reference in New Issue
Block a user