@tinyhttp/app 2.0.25 → 2.0.26
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/dist/index.js +8 -3
- package/dist/onError.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -132,11 +132,16 @@ const applyHandler = (h) => async (req, res, next) => {
|
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
class App extends Router {
|
|
135
|
+
middleware = [];
|
|
136
|
+
locals = {};
|
|
137
|
+
noMatchHandler;
|
|
138
|
+
onError;
|
|
139
|
+
settings;
|
|
140
|
+
engines = {};
|
|
141
|
+
applyExtensions;
|
|
142
|
+
attach;
|
|
135
143
|
constructor(options = {}) {
|
|
136
144
|
super();
|
|
137
|
-
this.middleware = [];
|
|
138
|
-
this.locals = {};
|
|
139
|
-
this.engines = {};
|
|
140
145
|
this.onError = (options == null ? void 0 : options.onError) || onErrorHandler;
|
|
141
146
|
this.noMatchHandler = (options == null ? void 0 : options.noMatchHandler) || this.onError.bind(this, { code: 404 });
|
|
142
147
|
this.settings = options.settings || { xPoweredBy: true, views: process.cwd() };
|
package/dist/onError.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NextFunction } from '@tinyhttp/router';
|
|
2
2
|
import type { Request } from './request.js';
|
|
3
3
|
import type { Response } from './response.js';
|
|
4
|
-
import type { App } from './app';
|
|
4
|
+
import type { App } from './app.js';
|
|
5
5
|
export declare type ErrorHandler = (this: App, err: any, req: Request, res: Response, next?: NextFunction) => void;
|
|
6
6
|
export declare const onErrorHandler: ErrorHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinyhttp/app",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26",
|
|
4
4
|
"description": "0-legacy, tiny & fast web framework as a replacement of Express",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://tinyhttp.v1rtl.site",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@tinyhttp/cookie": "2.0.5",
|
|
36
36
|
"@tinyhttp/proxy-addr": "2.0.5",
|
|
37
37
|
"@tinyhttp/req": "2.0.14",
|
|
38
|
-
"@tinyhttp/res": "2.0.
|
|
38
|
+
"@tinyhttp/res": "2.0.20",
|
|
39
39
|
"@tinyhttp/router": "2.0.6",
|
|
40
40
|
"header-range-parser": "1.1.3",
|
|
41
41
|
"regexparam": "^2.0.1"
|