@nano-app/backend 0.12.0 → 0.12.1

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/README.md CHANGED
@@ -88,6 +88,8 @@ Every option is optional.
88
88
 
89
89
  `packages` accepts `morgan`, `cors`, `helmet`, `compression`, `rateLimit`, `express` (`express.json` options), `urlencoded` and `betterAuth` (off by default: see [Better Auth](#better-auth)). The merge is **per section**: passing one key keeps the others; pass `false` to disable one.
90
90
 
91
+ `morgan` logs `:timestamp | :method :path :status` by default: `:path` is the path without its query string, so tokens sent there stay out of the logs. Set `format` with `:url` to log the full URL.
92
+
91
93
  ```ts
92
94
  createNanoApp({
93
95
  settings: { 'trust proxy': 1 },
package/build/index.js CHANGED
@@ -439,8 +439,11 @@ const INITIAL_CONFIG = {
439
439
  /** Initial middlewares */
440
440
  packages: {
441
441
  morgan: {
442
- tokens: { timestamp: () => Formatter.logDate() },
443
- format: ":timestamp | :method :url :status"
442
+ tokens: {
443
+ timestamp: () => Formatter.logDate(),
444
+ path: (oReq) => oReq.path
445
+ },
446
+ format: ":timestamp | :method :path :status"
444
447
  },
445
448
  cors: { methods: [
446
449
  "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nano-app/backend",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Express server with file-convention routes, plugins and an optional PostgreSQL layer",
5
5
  "type": "module",
6
6
  "main": "build/index.js",