File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
require ( 'dotenv' ) . config ( { path : path . join ( __dirname , '../../.env' ) } ) ;
3
3
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
+ } = {
5
15
port : 8000 ,
6
16
accessTokenExpiresIn : 15 ,
7
17
refreshTokenExpiresIn : 60 ,
Original file line number Diff line number Diff line change 1
- import path from 'path' ;
2
- require ( 'dotenv' ) . config ( { path : path . join ( __dirname , '../../.env' ) } ) ;
3
1
import mongoose from 'mongoose' ;
2
+ import customConfig from '../config/default' ;
4
3
5
- const dbUrl = process . env . MONGODB_URI as string ;
4
+ const dbUrl = customConfig . dbUri ;
6
5
7
6
const connectDB = async ( ) => {
8
7
try {
You can’t perform that action at this time.
0 commit comments