Webrtc monitor backend developed developed top of nodejs and docker Bootstrapped from meetrix/node-typescript-auth-backend.
- Ubuntu
- MacOS
- Windows
The following pre-requisites should be setup through your terminal on your development machine. Please refer to tool installation guides by the developers to set these up.
- Git
- Docker
-
Set VSCode's Typescript import module specifier for the workspace to
relative
for more information have a look here -
Run these commands
# Copy the .env.example contents into the .env cat .env.example > .env # Start services npm run services-up # Create admin user (For the first time). Refer setup commands in package.json for more information. (Make sure to change MONGO_HOST=localhost MONGO_PORT=27025 in env before run below commands. you have to revert those envs to default after ran these commands) npm run setup-create-admin npm run setup-generate-admin-token # Check whether the api is running http://localhost:9100/v1/spec
- Go to [http://localhost:9100/v1/spec]
- Click
Authorize
and add a tokenBearer <YOUR_TOKEN>
- Execute any API
- Make sure you are running all the containers with
docker-compose up
- Make sure you have install
ts-node
globally withnpm install -g ts-node
cd cli-tools
cat .env.example > .env
this will copy.env
file that allows local node processes to connect to docker mongo- Make sure to change MONGO_HOST=localhost MONGO_PORT=27025 in env before run below commands. you have to revert those envs to default after ran these commands
- Help:
ts-node cli-tools/user-create.ts --help
- Create user :
ts-node cli-tools/user-create.ts -e [email protected] -p dev12345 -r admin
- Get token:
ts-node cli-tools/user-get-token.ts -e [email protected] -v 48h
- Register plugin
ts-node cli-tools/plugin-create -e [email protected] -d meetrix.io
- Generate token for plugin
ts-node cli-tools/plugin-get-token.ts -d 'meetrix.io'
npm run setup-generate-plugin-token
- Use this token in
auth.token
insocket.io-client
connection options
{
url: 'http://localhost:9100',
options: {
path: '/stats/',
auth: {
token: 'xxxx'
}
Go to http://mongo.localhost:8087/
To run the tests simply use npm test
. If you want to use jest watch mode
use npm run watch-test
.