Running MIT Annotation Data Store

More fun getting my dev environment set up. I have mongodb installed, all the node packages, etc. I’ve modified my .env file to be thus:

NODE_ENV=development
PATH=bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin
PORT=5000
SECRET=foo
CONSUMER=localhost
VERSION=1.0
LIVE_DB=mongodb://localhost/annotationdb
LOCAL_DB=mongodb://localhost/annotationdb
STAGING_DB=mongodb://localhost/annotationdb

When I run ‘foreman start’, however, I get this message:

09:46:12 web.1  | started with pid 42726
09:46:12 web.1  | connect.multipart() will be removed in connect 3.0
09:46:12 web.1  | visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
09:46:12 web.1  | connect.limit() will be removed in connect 3.0
09:46:12 web.1  | Listening on 5000
09:46:12 web.1  | 
09:46:12 web.1  | events.js:72
09:46:12 web.1  |         throw er; // Unhandled 'error' event
09:46:12 web.1  |               ^
09:46:12 web.1  | Error: failed to connect to [undefined:27017]
09:46:12 web.1  |     at null.<anonymous> (/Users/widner/Projects/DLCL/Lacuna/repos/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:540:74)
09:46:12 web.1  |     at EventEmitter.emit (events.js:106:17)
09:46:12 web.1  |     at null.<anonymous> (/Users/widner/Projects/DLCL/Lacuna/repos/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
09:46:12 web.1  |     at EventEmitter.emit (events.js:98:17)
09:46:12 web.1  |     at Socket.<anonymous> (/Users/widner/Projects/DLCL/Lacuna/repos/MIT-Annotation-Data-Store/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:478:10)
09:46:12 web.1  |     at Socket.EventEmitter.emit (events.js:95:17)
09:46:12 web.1  |     at net.js:830:16
09:46:12 web.1  |     at process._tickCallback (node.js:415:13)
09:46:12 web.1  | exited with code 8
09:46:12 system | sending SIGTERM to 

I’m guessing the “failed to connect to [undefined:27017]” is the key. Do I need to add a port or credentials for some reason? I can connect locally to the mongodb without credentials. Thanks.

Solved this one myself (I think): .env needs a line defining DB (not just LOCAL_DB, etc.) because web.js appears to be looking for the DB variable, not any of the others.

Hi @mikewidner another good catch. I’ll be sure this is in the sample env. Thanks.