Distributed System Class' mini project. For frontend server repo, it is located here.
- node 8.11.1
- npm 5.6.0
- yarn 1.6.0
- mongodb 3.6.4
-
run mongodb
-
yarn install -
heartbeat server
- config variables about main server and backup server url in heartbeat.js
- run with
yarn start, server will run at port 5000 by default
-
API server
-
run with
yarn start [port] -
A deault port is 3001, but you can add an argument to change the port.
-
The port should match configuration of heartbeat server, if not heartbeat won't find any active server.
-
Run both of backend and heartbeat.
Hearthbeat will communicate with frontend about which backend server is avaiable.