-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor NestJS server setup to use Fastify adapter for performance
- Loading branch information
1 parent
d34323a
commit be1f211
Showing
6 changed files
with
47 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,18 @@ | |
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"packageManager": "[email protected].42", | ||
"packageManager": "[email protected].43", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@fastify/autoload": "^6.0.3", | ||
"supabase": "^2.2.1", | ||
"turbo": "^2.3.3" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.2.4", | ||
"@eslint/eslintrc": "^3.2.0", | ||
"@eslint/js": "^9.17.0", | ||
"@types/bun": "latest", | ||
"check-file": "^1.1.2", | ||
"eslint": "^9.17.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
|
@@ -26,7 +28,10 @@ | |
"eslint-plugin-react-refresh": "^0.4.16", | ||
"eslint-plugin-storybook": "^0.11.2", | ||
"prettier": "^3.4.2", | ||
"prettier-plugin-tailwindcss": "^0.6.9" | ||
"prettier-plugin-tailwindcss": "^0.6.9", | ||
"typescript-eslint": "latest", | ||
"@typescript-eslint/eslint-plugin": "latest", | ||
"@typescript-eslint/parser": "latest" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
|
@@ -35,5 +40,11 @@ | |
"plugin:storybook/recommended" | ||
] | ||
}, | ||
"workspaces": ["packages/*"] | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"module": "index.ts", | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"author": "", | ||
"private": true, | ||
"license": "UNLICENSED", | ||
"packageManager": "[email protected].42", | ||
"packageManager": "[email protected].43", | ||
"scripts": { | ||
"build": "nest build", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
|
@@ -21,34 +21,37 @@ | |
"test:e2e": "jest --config ./test/jest-e2e.json" | ||
}, | ||
"dependencies": { | ||
"@nestjs/common": "^10.0.0", | ||
"@nestjs/core": "^10.0.0", | ||
"@nestjs/platform-express": "^10.0.0", | ||
"reflect-metadata": "^0.2.0", | ||
"@fastify/helmet": "^13.0.1", | ||
"@nestjs/common": "^10.4.15", | ||
"@nestjs/core": "^10.4.15", | ||
"@nestjs/platform-express": "^10.4.15", | ||
"@nestjs/platform-fastify": "^10.4.15", | ||
"reflect-metadata": "^0.2.2", | ||
"rxjs": "^7.8.1" | ||
}, | ||
"devDependencies": { | ||
"@nestjs/cli": "^10.0.0", | ||
"@nestjs/schematics": "^10.0.0", | ||
"@nestjs/testing": "^10.0.0", | ||
"@nestjs/cli": "^10.4.9", | ||
"@nestjs/schematics": "^10.2.3", | ||
"@nestjs/testing": "^10.4.15", | ||
"@types/express": "^5.0.0", | ||
"@types/jest": "^29.5.2", | ||
"@types/node": "^20.3.1", | ||
"@types/supertest": "^6.0.0", | ||
"@typescript-eslint/eslint-plugin": "^8.0.0", | ||
"@typescript-eslint/parser": "^8.0.0", | ||
"eslint": "^8.0.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"jest": "^29.5.0", | ||
"prettier": "^3.0.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.10.5", | ||
"@types/supertest": "^6.0.2", | ||
"eslint": "^9.17.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.4.2", | ||
"source-map-support": "^0.5.21", | ||
"supertest": "^7.0.0", | ||
"ts-jest": "^29.1.0", | ||
"ts-loader": "^9.4.3", | ||
"ts-node": "^10.9.1", | ||
"ts-jest": "^29.2.5", | ||
"ts-loader": "^9.5.1", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.1.3" | ||
"typescript": "^5.7.2", | ||
"typescript-eslint": "^8.19.1", | ||
"@typescript-eslint/eslint-plugin": "latest", | ||
"@typescript-eslint/parser": "latest" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import { NestFactory } from '@nestjs/core'; | ||
import { AppModule } from './app.module'; | ||
import { | ||
FastifyAdapter, | ||
NestFastifyApplication, | ||
} from '@nestjs/platform-fastify'; | ||
|
||
async function bootstrap() { | ||
const app = await NestFactory.create(AppModule); | ||
const app = await NestFactory.create<NestFastifyApplication>( | ||
AppModule, | ||
new FastifyAdapter(), | ||
); | ||
await app.listen(process.env.PORT ?? 3000); | ||
} | ||
bootstrap(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.