Impl storage mongo driver and config

This commit is contained in:
Bel LaPointe
2020-07-12 21:28:52 -06:00
parent 2c13814177
commit 1b051ee1d5
9 changed files with 461 additions and 0 deletions

23
init.sh Normal file
View File

@@ -0,0 +1,23 @@
#! /bin/bash
port=57017
if ! curl -sS localhost:$port > /dev/null; then
prefix=/tmp/whodunit.db
mkdir -p $prefix/data
mongod \
--dbpath $prefix/data \
--logpath $prefix/log \
--pidfilepath $prefix/pid \
--port $port \
--fork
fi
mshell() {
mongo \
--quiet \
--port $port \
--eval "$*"
}
export DBURI=${DB_URI:-"mongodb://localhost:$port"}