@tinyhttp/app 2.0.20 → 2.0.21
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/app.d.ts +3 -3
- package/dist/extend.d.ts +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/onError.d.ts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/response.d.ts +2 -2
- package/package.json +7 -8
package/dist/app.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Server } from 'http';
|
|
3
|
-
import type { Request } from './request';
|
|
4
|
-
import type { Response } from './response';
|
|
5
|
-
import type { ErrorHandler } from './onError';
|
|
3
|
+
import type { Request } from './request.js';
|
|
4
|
+
import type { Response } from './response.js';
|
|
5
|
+
import type { ErrorHandler } from './onError.js';
|
|
6
6
|
import { Middleware, Handler, NextFunction, Router, UseMethodParams } from '@tinyhttp/router';
|
|
7
7
|
/**
|
|
8
8
|
* tinyhttp App has a few settings for toggling features
|
package/dist/extend.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Request } from './request';
|
|
1
|
+
import { Request } from './request.js';
|
|
2
2
|
import type { NextFunction } from '@tinyhttp/router';
|
|
3
|
-
import type { Response } from './response';
|
|
4
|
-
import { App } from './app';
|
|
3
|
+
import type { Response } from './response.js';
|
|
4
|
+
import { App } from './app.js';
|
|
5
5
|
/**
|
|
6
6
|
* Extends Request and Response objects with custom properties and methods
|
|
7
7
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { App } from './app';
|
|
2
|
-
export type { AppSettings, TemplateEngineOptions, TemplateFunc } from './app';
|
|
3
|
-
export * from './request';
|
|
4
|
-
import type { Request } from './request';
|
|
5
|
-
export * from './response';
|
|
6
|
-
import type { Response } from './response';
|
|
7
|
-
export { extendMiddleware } from './extend';
|
|
8
|
-
export { onErrorHandler } from './onError';
|
|
9
|
-
export type { ErrorHandler } from './onError';
|
|
1
|
+
export { App } from './app.js';
|
|
2
|
+
export type { AppSettings, TemplateEngineOptions, TemplateFunc } from './app.js';
|
|
3
|
+
export * from './request.js';
|
|
4
|
+
import type { Request } from './request.js';
|
|
5
|
+
export * from './response.js';
|
|
6
|
+
import type { Response } from './response.js';
|
|
7
|
+
export { extendMiddleware } from './extend.js';
|
|
8
|
+
export { onErrorHandler } from './onError.js';
|
|
9
|
+
export type { ErrorHandler } from './onError.js';
|
|
10
10
|
import type { NextFunction, Handler as RHandler, AsyncHandler as RAsyncHandler, SyncHandler as RSyncHandler, Middleware } from '@tinyhttp/router';
|
|
11
11
|
export declare type Handler = RHandler<Request, Response>;
|
|
12
12
|
export declare type AsyncHandler = RAsyncHandler<Request, Response>;
|
package/dist/onError.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NextFunction } from '@tinyhttp/router';
|
|
2
|
-
import type { Request } from './request';
|
|
3
|
-
import type { Response } from './response';
|
|
2
|
+
import type { Request } from './request.js';
|
|
3
|
+
import type { Response } from './response.js';
|
|
4
4
|
export declare type ErrorHandler = (err: any, req: Request, res: Response, next?: NextFunction) => void;
|
|
5
5
|
export declare const onErrorHandler: ErrorHandler;
|
package/dist/request.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { IncomingMessage } from 'http';
|
|
3
3
|
import { ParsedUrlQuery } from 'querystring';
|
|
4
4
|
import { Options, Ranges } from 'header-range-parser';
|
|
5
|
-
import { App } from './app';
|
|
5
|
+
import { App } from './app.js';
|
|
6
6
|
import type { Middleware, Handler } from '@tinyhttp/router';
|
|
7
|
-
import type { Response } from './response';
|
|
7
|
+
import type { Response } from './response.js';
|
|
8
8
|
import type { URLParams } from '@tinyhttp/req';
|
|
9
9
|
import type { Socket } from 'net';
|
|
10
10
|
import type { TLSSocket } from 'tls';
|
package/dist/response.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ServerResponse } from 'http';
|
|
3
3
|
import type { SerializeOptions } from '@tinyhttp/cookie';
|
|
4
|
-
import { Request } from './request';
|
|
5
|
-
import { App, TemplateEngineOptions } from './app';
|
|
4
|
+
import { Request } from './request.js';
|
|
5
|
+
import { App, TemplateEngineOptions } from './app.js';
|
|
6
6
|
import type { ReadStreamOptions, FormatProps, DownloadOptions } from '@tinyhttp/res';
|
|
7
7
|
export declare const renderTemplate: <O>(_req: Request, res: Response, app: App) => (file: string, data?: Record<string, any>, options?: Partial<{
|
|
8
8
|
cache: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinyhttp/app",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
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",
|
|
@@ -32,16 +32,15 @@
|
|
|
32
32
|
"author": "v1rtl",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tinyhttp/cookie": "2.0.
|
|
36
|
-
"@tinyhttp/proxy-addr": "2.0.
|
|
37
|
-
"@tinyhttp/req": "2.0.
|
|
38
|
-
"@tinyhttp/res": "2.0.
|
|
39
|
-
"@tinyhttp/router": "2.0.
|
|
35
|
+
"@tinyhttp/cookie": "2.0.4",
|
|
36
|
+
"@tinyhttp/proxy-addr": "2.0.4",
|
|
37
|
+
"@tinyhttp/req": "2.0.13",
|
|
38
|
+
"@tinyhttp/res": "2.0.16",
|
|
39
|
+
"@tinyhttp/router": "2.0.5",
|
|
40
40
|
"header-range-parser": "1.1.3",
|
|
41
41
|
"regexparam": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "rollup -c"
|
|
45
|
-
}
|
|
46
|
-
"readme": "# @tinyhttp/app\n\nThe core of tinyhttp. Contains the `App`, `Request` and `Response`. Additionally, it provides special tinyhttp-specific types.\n\n## Install\n\n```sh\npnpm i @tinyhttp/app\n```\n\n## Example\n\n```ts\nimport { App } from '@tinyhttp/app'\nimport type { Request, Response, NextFunction } from '@tinyhttp/app'\n\nnew App()\n .use((req: Request, res: Response, next: NextFunction) => {\n console.log('Did a request')\n next()\n })\n .get('/', (_, res) => res.send('<h1>Hello World</h1>'))\n .get('/page/:page', (req, res) => res.send(`You opened ${req.params.page}`))\n .listen(3000)\n```\n"
|
|
45
|
+
}
|
|
47
46
|
}
|