Skip to content

Commit

Permalink
feat: add x-response-time response header 🤖
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Feb 8, 2023
1 parent a3f0ba9 commit cb7a520
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 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 @@ -39,6 +39,7 @@
"pbf": "3.2.1",
"proj4": "2.8.1",
"request": "2.88.2",
"response-time": "^2.3.2",
"sanitize-filename": "1.6.3",
"sharp": "0.31.3",
"tileserver-gl-styles": "2.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import express from 'express';
import handlebars from 'handlebars';
import SphericalMercator from '@mapbox/sphericalmercator';
const mercator = new SphericalMercator();
import responseTime from 'response-time';
import morgan from 'morgan';
import { serve_data } from './serve_data.js';
import { serve_style } from './serve_style.js';
Expand Down Expand Up @@ -48,6 +49,7 @@ function start(opts) {
fonts: {},
};

app.use(responseTime({ suffix: false }));
app.enable('trust proxy');

if (process.env.NODE_ENV !== 'test') {
Expand Down

0 comments on commit cb7a520

Please sign in to comment.