-
Notifications
You must be signed in to change notification settings - Fork 1
Database Setup & Running Server
All the instructions will be posted below and kept up to date.
To install docker on your system please choose system:
https://docs.docker.com/toolbox/toolbox_install_windows/
https://docs.docker.com/docker-for-mac/install/
Next, run the Docker Quickstart Terminal and wait for it to report ready. (This may take several minutes.) [Troubleshooting]: If Docker Quick Start Terminal is failing to start (failed to start host-only something something...) Restart PC, and right-click run as administrator worked for me.
To get Mongo DB 4.0:
docker pull mongo:4.0
To run docker container:
docker run -p 27017:27017 --name mongo -v ~/data:/data -w /data -it mongo:4.0
When we will have data we will be using mongo-restore and mongo-dump and I will provide assistance for that. That is all for now.
To start the server cd into the server directory then please choose a package manager:
npm install
Install yarn.
npm install -g yarn
Then:
yarn
These commands will fetch all the submodules and dependencies required. There are 11 thousand. Should take no more than a minute. Once complete, it will transpile all the TS files into js in the dist folder.
Once you have your database running, go to connection.ts
Replace localhost in the following code snippet with your mongo docker container's ip address.
mongoose.connect("mongodb://localhost/blackdice", { useNewUrlParser: true });
To find the ip address, run docker-machine ip inside your docker command line.
node dist/src/server.js
install nodemon
npm install -g nodemon
then:
nodemon dist/src/server.js