Skip to content

Commit

Permalink
perf(client): use gzip compression for SSR (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDonochVA committed May 1, 2024
1 parent ce4b2da commit 125f3da
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/blog/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import compressionModule from 'compression';
import express from 'express';

import bootstrap from './src/main.server';
Expand All @@ -15,6 +16,8 @@ export function app(): express.Express {

const commonEngine = new CommonEngine();

server.use(compressionModule());

server.set('view engine', 'html');
server.set('views', browserDistFolder);

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"cheerio": "1.0.0-rc.12",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"compression": "^1.7.4",
"express": "^4.18.2",
"highlight.js": "^11.9.0",
"hono": "^4.2.7",
Expand All @@ -59,9 +60,9 @@
"@angular/compiler-cli": "17.3.4",
"@angular/language-service": "17.3.4",
"@cloudflare/workers-types": "^4.20231025.0",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@k11r/nx-cloudflare-wrangler": "^2.7.1",
"@nx/esbuild": "18.2.4",
"@nx/eslint": "18.2.4",
Expand All @@ -78,6 +79,7 @@
"@swc-node/register": "1.8.0",
"@swc/core": "~1.3.85",
"@swc/helpers": "~0.5.2",
"@types/compression": "^1.7.5",
"@types/express": "^4.17.20",
"@types/jest": "^29.4.0",
"@types/node": "18.19.31",
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 125f3da

Please sign in to comment.