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 11import path from 'path' ;
22require ( '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 ,
Original file line number Diff line number Diff line change 1- import path from 'path' ;
2- require ( 'dotenv' ) . config ( { path : path . join ( __dirname , '../../.env' ) } ) ;
31import 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
76const connectDB = async ( ) => {
87 try {
You can’t perform that action at this time.
0 commit comments