Skip to content

kiwilan/fastify-template

Repository files navigation

Fastify template

node version downloads license

tests codecov

fastify typescript node.js pnpm

A template for fastify with Typescript, eslint, pnpm and @kiwilan/fastify-utils.

Setup

pnpm i
cp .env.example .env
pnpm dev

Build

In .env:

LOG_LEVEL=error      # debug | error | fatal  | info | trace | warn | silent

PORT=3000 # pm2 port
BASE_URL=domain.com
HTTPS=true
pnpm build

Nginx

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
  }
}

License

MIT