- Clone this repo using
git clone https://github.com/shuperry/fastify-starterkit-api.git
. - Run
npm install
oryarn
to install dependencies. - Run
npm i pm2 pino pino-pretty -g
to install global dependencies. - Run
npm start
to start service in local development mode. - Run
pm2 logs --raw fastify-starterkit-api-local | pino-pretty -c -f -t SYS:standard
to see logs in local development mode.
We use nconf to manage configuration between different environment, the configuration of current environment file name is just the same as environment, and it is extend with src/config/default.js
.
- Start core serice script:
npm run prod_cluster
.
Execute start service script except local env need install pm2 globally:
npm install pm2 pino -g
.
- startup services:
- Start core serice script:
npm run dev
.
- show log scripts:
pm2 logs --raw fastify-starterkit-api-dev | pino -L