Skip to content

Commit

Permalink
add compression middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
in-mai-space committed Nov 6, 2024
1 parent cf1d61b commit afb4c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.685.0",
"@supabase/supabase-js": "^2.45.3",
"@types/compression": "^1.7.5",
"@types/express-session": "^1.18.0",
"@types/supertest": "^6.0.2",
"aws-sdk": "^2.1691.0",
"compression": "^1.7.5",
"connect-mongo": "^5.1.0",
"dotenv": "^16.4.5",
"express": "^4.19.2",
Expand Down
3 changes: 3 additions & 0 deletions backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { resolve } from 'path';
import dotenv from 'dotenv';
import { serve, setup } from 'swagger-ui-express';
import swaggerJsDoc from 'swagger-jsdoc';
import compression from 'compression';

dotenv.config({ path: resolve(__dirname, '../.env') });

Expand Down Expand Up @@ -46,6 +47,8 @@ const spec = swaggerJsDoc(options);
export const startServer = () => {
initializeLogging();

router.use(compression({ threshold: 0 }));

router.use(sessionMiddleware);

router.use('/api-docs', serve, setup(spec));
Expand Down

0 comments on commit afb4c60

Please sign in to comment.