一覧へ戻る
PierreBerger/fastify-starter(新しいタブで開きます)
主要言語: TypeScript
Fastify starter template with Typescript, Prisma, Zod and Vitest
- star 数
- 9
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2024/04/20
主要言語: TypeScript
Fastify starter template with Typescript, Prisma, Zod and Vitest
Fastify starter template with Typescript, Prisma and Vitest
Run the following command on your local environment:
git clone --depth=1 https://github.com/pierreberger/fastify-starter.git my-project-name
cd my-project-name
bun installcp .env.example .env
# open .env and modify the environment variables (if needed)Run the following command to create your SQLite database file. This also creates
the User and Post tables that are defined in
prisma/schema.prisma:
bun prisma migrate dev --name init
Launch your Fastify server in development mode with live reload:
bun run dev
Navigate to http://localhost:3000/ in your favorite browser to explore the API of your Fastify server.
All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
bun install |
Installs dependencies |
bun run dev |
Starts local dev server at localhost:3000 |
bun run test |
Run tests with Vitest |
bun run build |
Build your production site to ./dist/ |
bun run start |
Preview your build locally |
bun run format |
Format codes with Prettier |
bun run lint |
Run Eslint |
The environment variables can be found and modified in the .env file. They
come with these default values:
# Port number PORT=3000 DATABASE_URL="./data.db"