@openapi-typescript-infra/service 4.6.0 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/config/schema.d.ts +1 -1
- package/build/express-app/app.js +4 -1
- package/build/express-app/app.js.map +1 -1
- package/build/telemetry/requestLogger.js +2 -2
- package/build/telemetry/requestLogger.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/config/schema.ts +1 -1
- package/src/express-app/app.ts +3 -1
- package/src/telemetry/requestLogger.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-typescript-infra/service",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.2",
|
|
4
4
|
"description": "An opinionated framework for building configuration driven services - web, api, or ob. Uses OpenAPI, pino logging, express, confit, Typescript and vitest.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
package/src/config/schema.ts
CHANGED
package/src/express-app/app.ts
CHANGED
|
@@ -114,7 +114,9 @@ export async function startApp<
|
|
|
114
114
|
app.locals.meter = metrics.getMeterProvider().getMeter(name);
|
|
115
115
|
setupNodeMetrics(app.locals.meter, {});
|
|
116
116
|
|
|
117
|
-
if (config.trustProxy) {
|
|
117
|
+
if (config.trustProxy === true) {
|
|
118
|
+
app.enable('trust proxy');
|
|
119
|
+
} else if (config.trustProxy) {
|
|
118
120
|
app.set('trust proxy', config.trustProxy);
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -63,11 +63,11 @@ function finishLog<SLocals extends AnyServiceLocals = ServiceLocals<Configuratio
|
|
|
63
63
|
dur,
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
const path = req.route ? req.route.path :
|
|
66
|
+
const path = req.route ? { path: req.route.path } : undefined;
|
|
67
67
|
histogram.record(dur, {
|
|
68
68
|
status_code: endLog.s,
|
|
69
69
|
method: endLog.m,
|
|
70
|
-
path,
|
|
70
|
+
...path,
|
|
71
71
|
service: app.locals.name,
|
|
72
72
|
});
|
|
73
73
|
|