Compress responses using compression middleware in Express.js
app.use(
compression({
threshold: 1024 // = 1KB, smaller files will not be compressed
})
);
Compress responses using the configuration in Dropwizard
ci_web: | |
name: "Build & Tests & Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout project" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 |
import pino from 'express-pino-logger'; | |
// use middleware | |
app.use( | |
pino({ | |
autoLogging: { | |
ignorePaths: ['/healthcheck'] | |
} | |
}) | |
); |
import { NavigationStart, Router } from '@angular/router'; | |
import { filter, first, takeUntil } from 'rxjs/operators'; | |
// Use this to abort things like HTTP requests when navigating to another route. | |
// Example: cancel polling an API when the user navigates to another route. | |
destroyIfNavigatingToAnotherRoute(currentRoute: string) { | |
return takeUntil<any>( | |
this.router.events.pipe( | |
filter((routerEvent) => routerEvent instanceof NavigationStart && !routerEvent.url.startsWith(currentRoute)), | |
first() |
import logger from 'morgan'; | |
// use middleware | |
app.use( | |
logger("dev", { | |
skip(req, _res) { | |
return req.baseUrl.includes('/healthcheck'); // customize this to your needs | |
} | |
}) | |
); |
default: | |
image: node:12.10.0 | |
before_script: | |
- npm ci | |
Build: | |
script: | |
- npm run build | |
Run tests: |
default: | |
image: mhart/alpine-node:12 | |
before_script: | |
- npm ci | |
Build: | |
script: | |
- npm run build | |
Run tests: |
<div *ngIf="results$ | async as results; else showSpinner"> | |
<ul *ngIf="results.length; else noResults"> | |
<li *ngFor="let result of results">{{ result.name }}</li> | |
</ul> | |
<ng-template #noResults>No results found.</ng-template> | |
</div> | |
<ng-template #showSpinner> | |
<app-spinner></app-spinner> | |
</ng-template> |
Compress responses using compression middleware in Express.js
app.use(
compression({
threshold: 1024 // = 1KB, smaller files will not be compressed
})
);
Compress responses using the configuration in Dropwizard
{ | |
"compileOnSave": false, | |
"compilerOptions": { | |
"baseUrl": "./", | |
"outDir": "./dist/out-tsc", | |
"sourceMap": true, | |
"module": "esnext", | |
"moduleResolution": "node", | |
"emitDecoratorMetadata": true, | |
"experimentalDecorators": true, |
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | |
# For additional information regarding the format and rule options, please see: | |
# https://github.com/browserslist/browserslist#queries | |
# You can see what browsers were selected by your queries by running: | |
# npx browserslist | |
last 5 Chrome versions | |
last 5 ChromeAndroid versions |