@adonisjs/http-server 6.0.1-0 → 6.0.2-0
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.
|
@@ -16,8 +16,7 @@ export declare class Server<NamedMiddleware extends Record<string, LazyImport<Mi
|
|
|
16
16
|
errorHandler(handler: LazyImport<ErrorHandlerAsAClass>): this;
|
|
17
17
|
boot(): Promise<void>;
|
|
18
18
|
setNodeServer(server: HttpServer | HttpsServer): void;
|
|
19
|
-
close(): Promise<void>;
|
|
20
19
|
getNodeServer(): HttpServer<typeof IncomingMessage, typeof ServerResponse> | HttpsServer<typeof IncomingMessage, typeof ServerResponse> | undefined;
|
|
21
|
-
getRouter(): Router<
|
|
20
|
+
getRouter(): Router<NamedMiddleware> | undefined;
|
|
22
21
|
handle(req: IncomingMessage, res: ServerResponse): Promise<any>;
|
|
23
22
|
}
|
package/build/src/server/main.js
CHANGED
|
@@ -93,20 +93,6 @@ export class Server {
|
|
|
93
93
|
setNodeServer(server) {
|
|
94
94
|
this.#underlyingHttpServer = server;
|
|
95
95
|
}
|
|
96
|
-
close() {
|
|
97
|
-
return new Promise((resolve, reject) => {
|
|
98
|
-
if (!this.#underlyingHttpServer || !this.#underlyingHttpServer.listening) {
|
|
99
|
-
resolve();
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
this.#underlyingHttpServer.close((error) => {
|
|
103
|
-
if (error) {
|
|
104
|
-
return reject(error);
|
|
105
|
-
}
|
|
106
|
-
resolve();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
96
|
getNodeServer() {
|
|
111
97
|
return this.#underlyingHttpServer;
|
|
112
98
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ContainerResolver } from '@adonisjs/fold';
|
|
2
|
-
import type { NextFn } from '
|
|
3
|
-
import type { Constructor } from './base.js';
|
|
2
|
+
import type { Constructor, NextFn } from './base.js';
|
|
4
3
|
import type { HttpContext } from '../http_context/main.js';
|
|
5
4
|
export type MiddlewareAsClass = Constructor<{
|
|
6
5
|
handle: (ctx: HttpContext, next: NextFn, args?: any) => any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { QSParserConfig } from './qs.js';
|
|
1
2
|
import type { Constructor } from './base.js';
|
|
2
3
|
import type { RequestConfig } from './request.js';
|
|
3
4
|
import type { ResponseConfig } from './response.js';
|
|
4
5
|
import type { HttpContext } from '../http_context/main.js';
|
|
5
|
-
import { QSParserConfig } from './qs.js';
|
|
6
6
|
export type ServerErrorHandler = {
|
|
7
7
|
handle: (error: any, ctx: HttpContext) => any;
|
|
8
8
|
};
|