https://github.com/kiwilan/fastify-template
Template for Fastify.
https://github.com/kiwilan/fastify-template
fastify nodejs typescript
Last synced: 2 months ago
JSON representation
Template for Fastify.
- Host: GitHub
- URL: https://github.com/kiwilan/fastify-template
- Owner: kiwilan
- License: bsd-2-clause
- Created: 2023-02-25T17:20:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-20T06:50:14.000Z (almost 3 years ago)
- Last Synced: 2025-03-28T09:10:00.987Z (about 1 year ago)
- Topics: fastify, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 941 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fastify template
[![node][node-version-src]][node-version-href]
[![version][version-src]][version-href]
[![downloads][downloads-src]][downloads-href]
[![license][license-src]][license-href]
[![tests][tests-src]][tests-href]
[![codecov][codecov-src]][codecov-href]
[](https://www.fastify.io)
[](https://www.typescriptlang.org)
[](https://nodejs.org/en)
[](https://pnpm.io)
A template for [fastify](https://www.fastify.io/) with Typescript, eslint, pnpm and `@kiwilan/fastify-utils`.
## Setup
```bash
pnpm i
```
```bash
cp .env.example .env
```
```bash
pnpm dev
```
## Build
In `.env`:
```bash
LOG_LEVEL=error # debug | error | fatal | info | trace | warn | silent
PORT=3000 # pm2 port
BASE_URL=domain.com
HTTPS=true
```
```bash
pnpm build
```
### Nginx
```bash
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](LICENSE)
[version-src]: https://img.shields.io/npm/v/@kiwilan/filesystem.svg?style=flat-square&colorA=18181B&colorB=339933
[version-href]: https://www.npmjs.com/package/@kiwilan/filesystem
[node-version-src]: https://img.shields.io/static/v1?style=flat-square&label=Node.js&message=v16&color=339933&logo=node&logoColor=ffffff&labelColor=18181b
[node-version-href]: https://www.php.net/
[downloads-src]: https://img.shields.io/npm/dt/@kiwilan/filesystem.svg?style=flat-square&colorA=18181B&colorB=339933
[downloads-href]: https://www.npmjs.com/package/@kiwilan/filesystem
[license-src]: https://img.shields.io/github/license/kiwilan/node-filesystem.svg?style=flat-square&colorA=18181B&colorB=339933
[license-href]: https://github.com/kiwilan/node-filesystem/blob/main/README.md
[tests-src]: https://img.shields.io/github/actions/workflow/status/kiwilan/node-filesystem/run-tests.yml?branch=main&label=tests&style=flat-square&colorA=18181B
[tests-href]: https://github.com/kiwilan/node-filesystem/actions/workflows/run-tests.yml
[codecov-src]: https://codecov.io/gh/kiwilan/node-filesystem/branch/main/graph/badge.svg?token=SHQV8D60YV
[codecov-href]: https://codecov.io/gh/kiwilan/node-filesystem