Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fastify with typescript and tsup example #883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions starter/fastify-typescript-tsup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
/node_modules
/.pnp
.pnp.js

# Testing
/coverage

# Next.js
/.next/
/out/
next-env.d.ts

# Production
build
dist

# Misc
.DS_Store
*.pem

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Local ENV files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Vercel
.vercel

# Turborepo
.turbo

# typescript
*.tsbuildinfo
21 changes: 21 additions & 0 deletions starter/fastify-typescript-tsup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Fastify + Typescript with Tsup + Vercel

This example shows how to setup a [Fastify](https://www.fastify.io/) server with TypeScript using [tsup](https://tsup.egoist.dev/) for bundling.

## Demo

https://fastify-typescript-tsup.vercel.app

## Running Locally

```bash
pnpm i
pnpm i -g vercel@latest
pnpm dev
```

### One-Click Deploy

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/starter/fastify-typescript-tsup&project-name=fastify-typescript-tsup&repository-name=fastify-typescript-tsup)
20 changes: 20 additions & 0 deletions starter/fastify-typescript-tsup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "fastify-typescript-tsup",
"repository": "https://github.com/vercel/examples.git",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"dev": "tsup --watch & vercel dev",
"build": "tsup"
},
"devDependencies": {
"@types/node": "^20.11.26",
"@vercel/node": "^3.0.22",
"tsup": "^8.0.2",
"typescript": "^5.4.2"
},
"dependencies": {
"fastify": "^4.26.2"
}
}
Loading