#Managing LabShare Services
PM2 is a great tool for mananging LabShare API services. Install it globally using npm i -g pm2
.
After installing pm2 globally following generic instructions can be followed to run any lsc
command and have pm2 watch for the whole repository.
From the root of project repository run:
echo -e '#!/bin/bash\nlsc services start' > devstart.sh && echo 'devstart.sh' >> .git/info/exclude
Once the script file is succesfully created and aded to local gitignore, lsc services start
- line #2 of devstart.sh could be replaced by any command that starts labshare services via bash.
The script can then be started by pm2 start devstart.sh --watch && pm2 logs
and stopped with pm2 delete devstart.sh
when desired.
##PM2 documentation
###Quick start ###Configuring PM2 applications ###Running PM2 as a Windows service
The sample-services.json file can be used as an example PM2 configuration file for LabShare services. Reference PM2 as a Windows service for a Windows-specific services.json
.