diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-11-24 12:40:17 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-11-24 12:40:17 -0500 |
| commit | 47c3a54e2e5935e4db526637ef3f108bd98fce9c (patch) | |
| tree | 7fc77b76733e4286fb14618b1f23fc2bf43b5804 | |
| parent | d941ec46ee1d3842387837377140e8d1fc854b17 (diff) | |
add repl script, preloads schema
| -rw-r--r-- | server/repl.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/repl.js b/server/repl.js new file mode 100644 index 0000000..ba94d45 --- /dev/null +++ b/server/repl.js @@ -0,0 +1,17 @@ +var DB_HOST = 'localhost' +var mongoose = require('mongoose') +mongoose.connect('mongodb://' + DB_HOST + '/vvalls', {}, function(){ + console.log("vvalls: connected to", DB_HOST) + var repl = require("repl").start({}); + [ "./lib/schemas/User", + "./lib/schemas/Collaborator", + "./lib/schemas/Documentation", + "./lib/schemas/Layout", + "./lib/schemas/Media", + "./lib/schemas/Project", + ].forEach(function(modName){ + // console.log(name, modName) + var namez = modName.split("/"), name = namez[namez.length-1]; + repl.context[name] = require(modName); + }); +}); |
