Skip to content

Commit

Permalink
yakin
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusefendi52 committed Apr 7, 2024
1 parent 391cc03 commit d5241c2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
out: './server/db/drizzle',
driver: 'turso',
dbCredentials: {
url: 'libsql://app-deployin-yunusefendi52.turso.io',
authToken: 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhIjoicnciLCJpYXQiOjE3MTI0ODk2NDAsImlkIjoiYjc3ODQ3YTgtOGViNi00ZWUyLWIwNmItNjJiNGQ5MGIyYzAxIn0.CoOzcTsVKVQSwfNl8I1P-k5mU8WPib1Qi0d77UdBC0M8FScfHdgD3qgJQtxUEq0I1IXJ7WN-c8NYpwnT5IqcDg',
url: process.env.DB_URL!,
authToken: process.env.DB_AUTH_TOKEN!,
},
} satisfies Config;
4 changes: 2 additions & 2 deletions server/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { drizzle } from "drizzle-orm/libsql/driver";
import * as schema from '~/server/db/schema';

const client = createClient({
url: 'libsql://app-deployin-yunusefendi52.turso.io',
authToken: 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhIjoicnciLCJpYXQiOjE3MTI0ODk2NDAsImlkIjoiYjc3ODQ3YTgtOGViNi00ZWUyLWIwNmItNjJiNGQ5MGIyYzAxIn0.CoOzcTsVKVQSwfNl8I1P-k5mU8WPib1Qi0d77UdBC0M8FScfHdgD3qgJQtxUEq0I1IXJ7WN-c8NYpwnT5IqcDg',
url: process.env.DB_URL!,
authToken: process.env.DB_AUTH_TOKEN!,
})
const db = () => drizzle(client, { schema, logger: true });
export default db
1 change: 0 additions & 1 deletion server/middleware/00.start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { LibSQLDatabase } from 'drizzle-orm/libsql';

declare module 'h3' {
interface H3EventContext {
prisma: unknown,
s3Client: S3Client,
s3: S3,
drizzle: LibSQLDatabase<typeof schema>,
Expand Down
9 changes: 6 additions & 3 deletions server/plugins/startup.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { services } from "../services"
import { S3, S3Client, type S3ClientConfig } from "@aws-sdk/client-s3"

const endpoint = process.env.S3_ENDPOINT!
const accessKeyId = process.env.S3_ACCESS_KEY_ID!
const secretAccessKey = process.env.S3_SECRET_ACCESS_KEY!
export default defineNitroPlugin(async (nuxtApp) => {
const s3Config: S3ClientConfig = {
credentials: {
accessKeyId: 'niMVVLTJtujejdnkkceX',
secretAccessKey: 'n8FRdjEn7mAKKSq2hpnXAShu6GhqSj8PqQ0IGl9H'
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
},
endpoint: 'http://127.0.0.1:9000',
endpoint: endpoint,
forcePathStyle: true,
region: 'us-east-1',
}
Expand Down

0 comments on commit d5241c2

Please sign in to comment.