File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import path from 'path';
44import { uniqWith , isEqual } from 'lodash' ;
55require ( 'dotenv' ) . config ( { path : path . resolve ( '.env' ) } ) ;
66const ObjectId = mongoose . Types . ObjectId ;
7- mongoose . connect ( 'mongodb://localhost:27017/p5js-web-editor' ) ;
7+ mongoose . connect ( process . env . MONGO_URL ) ;
88mongoose . connection . on ( 'error' , ( ) => {
99 console . error (
1010 'MongoDB Connection Error. Please make sure that MongoDB is running.'
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { User } from '../models/user';
66import Project from '../models/project' ;
77import async from 'async' ;
88require ( 'dotenv' ) . config ( { path : path . resolve ( '.env' ) } ) ;
9- mongoose . connect ( 'mongodb://localhost:27017/p5js-web-editor' ) ;
9+ mongoose . connect ( process . env . MONGO_URL ) ;
1010mongoose . connection . on ( 'error' , ( ) => {
1111 console . error (
1212 'MongoDB Connection Error. Please make sure that MongoDB is running.'
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import dotenv from 'dotenv';
1414dotenv . config ( { path : path . resolve ( '.env' ) } ) ;
1515
1616async 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.'
You can’t perform that action at this time.
0 commit comments