/microservice

Microservice boilerplate built in Node.js

Primary LanguageJavaScriptMIT LicenseMIT

microservice

Microservice boilerplate built in Node.js.

Yarn Scripts

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.

Helpful Links

PM2

Configuration Example

// 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;

Nginx & Certbot