Skip to content

Commit 68e2e16

Browse files
authored
Merge pull request #4206 from Geethegreat/mongo-url-clean
refactor: replace hardcoded MongoDB URLs with process.env.MONGO_URL
2 parents e1ca052 + eace20f commit 68e2e16

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

server/migrations/db_reformat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path';
44
import { uniqWith, isEqual } from 'lodash';
55
require('dotenv').config({ path: path.resolve('.env') });
66
const ObjectId = mongoose.Types.ObjectId;
7-
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
7+
mongoose.connect(process.env.MONGO_URL);
88
mongoose.connection.on('error', () => {
99
console.error(
1010
'MongoDB Connection Error. Please make sure that MongoDB is running.'

server/migrations/moveBucket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { User } from '../models/user';
66
import Project from '../models/project';
77
import async from 'async';
88
require('dotenv').config({ path: path.resolve('.env') });
9-
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
9+
mongoose.connect(process.env.MONGO_URL);
1010
mongoose.connection.on('error', () => {
1111
console.error(
1212
'MongoDB Connection Error. Please make sure that MongoDB is running.'

server/migrations/s3UnderUser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotenv from 'dotenv';
1414
dotenv.config({ path: path.resolve('.env') });
1515

1616
async function main() {
17-
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
17+
mongoose.connect(process.env.MONGO_URL);
1818
mongoose.connection.on('error', () => {
1919
console.error(
2020
'MongoDB Connection Error. Please make sure that MongoDB is running.'

0 commit comments

Comments
 (0)