Skip to content

Commit

Permalink
feat: add @fastify/compress (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki authored Dec 6, 2023
1 parent 70c597a commit 4052e05
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 22 deletions.
95 changes: 74 additions & 21 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"wait-on": "^7.1.0"
},
"dependencies": {
"@fastify/compress": "^6.5.0",
"@fastify/cors": "^8.4.2",
"@helia/ipns": "^3.0.0",
"@helia/unixfs": "1.x",
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import compress from '@fastify/compress'
import cors from '@fastify/cors'
import debug from 'debug'
import Fastify from 'fastify'
Expand Down Expand Up @@ -45,7 +46,9 @@ await app.register(cors, {
strictPreflight: false,
preflightContinue: true
})

await app.register(compress, {
global: true
})
heliaServer.routes.forEach(({ path, type, handler }: RouteEntry) => {
app.route({
method: type,
Expand Down

0 comments on commit 4052e05

Please sign in to comment.