This is the backend API for berkmancenter/threads_client.
- Create file
.env.local
and copy contents of.env.example
. Feel free to change the port number in the file but make sure to make changes on fronend env file to reflect the correct port number. Also, if you change the port number, make sure to change the port numbers indocker-compose.yml
as well. The port number for socket io is defined implicitly in the app as5555
and can be changed by making change to file/src/websockets/index.js
- Edit
docker-compose.dev.yml
file to add the following block to thenode-app
service
env_file:
- .env.local
the full block should then look like this:
services:
node-app:
env_file:
- .env.local
- Run below docker compose command to start the server
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
- Start by copying
.env.example
to.env
. - Install
mongodb
- Run MongoDB with
mongod
- Install all dependencies with
npm install
. - Run
npm run dev
to serve the API locally.
Unit and integration tests can be run with npm run test
, and a coverage report can be seen with npm run coverage
.
Stress tests can be run from the client repo in the k6 directory.
- Pull the latest code from Github (currently the dev branch)
- Configure .env and install dependencies
- Run
npm run start
to serve the API with PM2