A template for fastify with Typescript, eslint, pnpm and @kiwilan/fastify-utils
.
pnpm i
cp .env.example .env
pnpm dev
In .env
:
LOG_LEVEL=error # debug | error | fatal | info | trace | warn | silent
PORT=3000 # pm2 port
BASE_URL=domain.com
HTTPS=true
pnpm build
server {
listen 80;
listen [::]:80;
server_name api.domain.com;
charset utf-8;
error_log /var/log/nginx/api.log warn;
access_log /var/log/nginx/api.log;
location / {
include proxy_params;
proxy_pass http://localhost:3000; # pm2 port
}
}