Microservice boilerplate built in Node.js.
yarn test
Placeholder script to run tests.
yarn lint
Run ESLint on .js files in /src and return a report on syntax warnings/errors.
yarn dev
Start Express server in development environment with nodemon watching for file changes.
yarn start
Start Express server in test environment.
yarn pm2-start
Start pm2 processes defined in ecosystem.config.js.
yarn pm2-restart
Restart pm2 processes defined in ecosystem.config.js.
// ecosystem.config.js
const ecosystemConfig = {
apps: [
{
name: "microservice",
script: "./src/index.js",
env: {
PORT: 3000,
NODE_ENV: "production",
TZ: "America/New_York",
},
},
],
};
module.exports = ecosystemConfig;