Refactor envars for easier self-hosting

This commit is contained in:
Tuan Dang
2022-11-20 22:54:38 -05:00
parent 0f6675942d
commit 896760903a
12 changed files with 66 additions and 66 deletions
+2 -3
View File
@@ -6,7 +6,7 @@ import mongoose from 'mongoose';
import dotenv from 'dotenv';
dotenv.config();
import * as Sentry from '@sentry/node';
import { PORT, SENTRY_DSN, NODE_ENV, MONGO_URL, WEBSITE_URL } from './config';
import { PORT, SENTRY_DSN, NODE_ENV, MONGO_URL, SITE_URL } from './config';
import { apiLimiter } from './helpers/rateLimiter';
const app = express();
@@ -38,7 +38,6 @@ import {
} from './routes';
const connectWithRetry = () => {
console.log('MONGO_URL', MONGO_URL);
mongoose.connect(MONGO_URL)
.then(() => console.log('Successfully connected to DB'))
.catch((e) => {
@@ -55,7 +54,7 @@ app.enable('trust proxy');
app.use(cookieParser());
app.use(cors({
credentials: true,
origin: WEBSITE_URL
origin: SITE_URL
}));
if (NODE_ENV === 'production') {