if retore url is not in mongo don't blow up

This commit is contained in:
Henry Oswald 2014-04-15 14:19:20 +01:00
parent 4b11790a54
commit 8795a8a921

View file

@ -1,6 +1,12 @@
Settings = require "settings-sharelatex"
mongojs = require "mongojs"
logger = require("logger-sharelatex")
if Settings.mongo.restoreUrl?
logger.log "restore url defined, talking to old db"
db = mongojs.connect(Settings.mongo.restoreUrl, ["projects", "users"])
else
logger.log "restore not not defined, continuing as normal"
db = {}
ObjectId = mongojs.ObjectId
VersioningApiHandler = require "../Versioning/VersioningApiHandler"