Skip to content

Commit

Permalink
feat: add dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
ymzuiku committed Oct 4, 2023
1 parent 5263fa2 commit c1c8529
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@zerodevx/svelte-toast": "^0.9.5",
"aws-sdk": "^2.1458.0",
"dayjs": "^1.11.9",
"dotenv": "^16.3.1",
"google-auth-library": "^9.0.0",
"howler": "^2.2.3",
"nightwind": "^1.1.13",
Expand Down
14 changes: 8 additions & 6 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capacity" content="fullscreen" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="Writeflowy" />
<meta name="format-detection" content="telephone=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="twitter:creator" content="@tldraw" />
<meta name="twitter:site" content="@tldraw" />
<meta name="twitter:card" content="summary_large_image" />
Expand All @@ -21,6 +15,7 @@
<meta property="og:image" content="%sveltekit.assets%/logo.svg" />
<link rel="icon" href="%sveltekit.assets%/logo.svg" />
<meta name="application-name" content="ai-sentence" />
<meta name="apple-mobile-web-app-title" content="Writeflowy" />
<meta name="twitter:title" content="Writeflowy" />
<meta property="og:title" content="Writeflowy" />
<meta property="og:site_name" content="Writeflowy" />
Expand All @@ -30,6 +25,13 @@
<meta name="twitter:description" content="AI learn sentences" />
<meta property="og:description" content="AI learn sentences" />
<meta name="keywords" content="AI, learn english, english, sentences, words, chatgpt" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="Writeflowy" />
<meta name="apple-mobile-web-app-capacity" content="fullscreen" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="/icon/icon256.png" />
<link rel="manifest" href="/manifest.json" />
<script src="https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/server/middlewares/emailx.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { config } from 'dotenv';
import nodemailer from 'nodemailer';

config();
interface Emailx {
title: string;
email: string;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/server/middlewares/openai.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { config } from 'dotenv';
import OpenAI from 'openai';
import type { RequestOptions } from 'openai/core';
import type {
Expand All @@ -6,6 +7,7 @@ import type {
} from 'openai/resources/chat';
export let openai: OpenAI;

config();
// type Model =
// | 'gpt-4'
// | 'gpt-4-0314'
Expand Down
3 changes: 3 additions & 0 deletions src/lib/server/middlewares/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { PrismaClient } from '@prisma/client';
import { config } from 'dotenv';

config();

export const prisma = new PrismaClient();
2 changes: 2 additions & 0 deletions src/lib/server/middlewares/redisx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// import Redis from 'ioredis';
import { config } from 'dotenv';
import { createClient } from 'redis';

config();
export const redisx = createClient({ url: process?.env?.REDIS_URL || '' });
redisx.connect();
// export const redisx = new Redis(process?.env?.REDIS_URL || '', { lazyConnect: true });
2 changes: 2 additions & 0 deletions src/lib/server/middlewares/s3.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import AWS from 'aws-sdk';
import { config } from 'dotenv';

config();
export const s3 = new AWS.S3({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
Expand Down

0 comments on commit c1c8529

Please sign in to comment.