File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ API_URL=/api
55CORS_ORIGIN = http://localhost:8080
66MONGODB_URI = mongodb://localhost:27017/code-paster
77STATIC_FILES_PATH = " ../../front/dist"
8+ MONGO_EXPIRATION_TIME = ' 2d'
Original file line number Diff line number Diff line change 11export const envConstants = {
2- NODE_ENV : process . env . NODE_ENV ,
3- PORT : process . env . PORT ,
4- isMockRepository : process . env . MOCK_REPOSITORY === 'true' ,
5- MONGODB_URI : process . env . MONGODB_URI ,
6- API_URL : process . env . API_URL ,
7- CORS_ORIGIN : process . env . CORS_ORIGIN ,
8- isProduction : process . env . NODE_ENV === 'production' ,
9- STATIC_FILES_PATH : process . env . STATIC_FILES_PATH
10- } ;
11-
12-
2+ NODE_ENV : process . env . NODE_ENV ,
3+ PORT : process . env . PORT ,
4+ isMockRepository : process . env . MOCK_REPOSITORY === 'true' ,
5+ MONGODB_URI : process . env . MONGODB_URI ,
6+ API_URL : process . env . API_URL ,
7+ CORS_ORIGIN : process . env . CORS_ORIGIN ,
8+ isProduction : process . env . NODE_ENV === 'production' ,
9+ STATIC_FILES_PATH : process . env . STATIC_FILES_PATH ,
10+ MONGO_EXPIRATION_TIME : process . env . MONGO_EXPIRATION_TIME ,
11+ } ;
Original file line number Diff line number Diff line change 11import { Document , model , Schema } from 'mongoose' ;
22import { RoomInfo } from 'dals' ;
3+ import { envConstants } from 'core' ;
34
45const roomSchema = new Schema ( {
56 room : Schema . Types . String ,
@@ -8,7 +9,7 @@ const roomSchema = new Schema({
89 type : Schema . Types . Date ,
910 default : Date . now ,
1011 index : {
11- expires : '2d' ,
12+ expires : envConstants . MONGO_EXPIRATION_TIME ,
1213 } ,
1314 } ,
1415} ) ;
Original file line number Diff line number Diff line change 11import { Document , model , Schema } from 'mongoose' ;
22import { UserSession } from 'dals/session' ;
3+ import { envConstants } from 'core/constants' ;
34
45const userSessionSchema = new Schema ( {
56 room : Schema . Types . String ,
@@ -10,7 +11,7 @@ const userSessionSchema = new Schema({
1011 type : Schema . Types . Date ,
1112 default : Date . now ,
1213 index : {
13- expires : '2d' ,
14+ expires : envConstants . MONGO_EXPIRATION_TIME ,
1415 } ,
1516 } ,
1617} ) ;
You can’t perform that action at this time.
0 commit comments