Skip to content

Commit

Permalink
feat: adopt @fastify/etag
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Jun 9, 2024
1 parent 97e7c10 commit 6b813ae
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@aws-sdk/client-s3": "^3.569.0",
"@aws-sdk/s3-request-presigner": "^3.572.0",
"@fastify/cookie": "^9.3.1",
"@fastify/etag": "^5.2.0",
"@fastify/helmet": "^11.1.1",
"@fastify/static": "^7.0.4",
"@prisma/client": "^5.13.0",
Expand Down
2 changes: 2 additions & 0 deletions server/service/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import cookie from '@fastify/cookie';
import fastifyEtag from '@fastify/etag';
import helmet from '@fastify/helmet';
import fastifyStatic from '@fastify/static';
import type { FastifyInstance, FastifyServerFactory } from 'fastify';
Expand All @@ -12,6 +13,7 @@ export const init = (serverFactory?: FastifyServerFactory): FastifyInstance => {

fastify.register(helmet);
fastify.register(cookie);
fastify.register(fastifyEtag, { weak: true });
fastify.register(fastifyStatic, {
root: join(process.cwd(), '../client/out'),
setHeaders: (res) => res.setHeader('content-security-policy', undefined),
Expand Down

0 comments on commit 6b813ae

Please sign in to comment.