Skip to content

Commit 040be46

Browse files
committed
updated
1 parent 70dfd82 commit 040be46

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/server/src/config/default.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import path from 'path';
22
require('dotenv').config({ path: path.join(__dirname, '../../.env') });
33

4-
const customConfig = {
4+
const customConfig: {
5+
port: number;
6+
accessTokenExpiresIn: number;
7+
refreshTokenExpiresIn: number;
8+
origin: string;
9+
dbUri: string;
10+
accessTokenPrivateKey: string;
11+
accessTokenPublicKey: string;
12+
refreshTokenPrivateKey: string;
13+
refreshTokenPublicKey: string;
14+
} = {
515
port: 8000,
616
accessTokenExpiresIn: 15,
717
refreshTokenExpiresIn: 60,

packages/server/src/utils/connectDB.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import path from 'path';
2-
require('dotenv').config({ path: path.join(__dirname, '../../.env') });
31
import mongoose from 'mongoose';
2+
import customConfig from '../config/default';
43

5-
const dbUrl = process.env.MONGODB_URI as string;
4+
const dbUrl = customConfig.dbUri;
65

76
const connectDB = async () => {
87
try {

0 commit comments

Comments
 (0)