@art-ws/fastify-http-server 2.0.16 → 2.0.18

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.
@@ -4,7 +4,7 @@ export type { FastifyInstance, FastifyReply, FastifyRequest, FastifyRouteShortha
4
4
  export type FastifyHook = (options: {
5
5
  fastify: FastifyInstance;
6
6
  }) => Promise<void>;
7
- export declare function createHttpServer({ routes, port, handlers, plugins, onWebsocket, onPlugin, onBeforeReady, onAfterReady, }: {
7
+ export declare function createHttpServer({ routes, port, handlers, plugins, onWebsocket, onPlugin, onBeforeReady, onAfterReady, onAfterListen, }: {
8
8
  routes: RouteDef<FastifyRequest, FastifyReply, FastifyInstance>[];
9
9
  port?: number;
10
10
  handlers?: {
@@ -24,6 +24,7 @@ export declare function createHttpServer({ routes, port, handlers, plugins, onWe
24
24
  onPlugin?: FastifyHook;
25
25
  onBeforeReady?: FastifyHook;
26
26
  onAfterReady?: FastifyHook;
27
+ onAfterListen?: FastifyHook;
27
28
  }): Promise<{
28
29
  port: number;
29
30
  fastify: Fastify.FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, Fastify.FastifyBaseLogger, Fastify.FastifyTypeProviderDefault> & PromiseLike<Fastify.FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, Fastify.FastifyBaseLogger, Fastify.FastifyTypeProviderDefault>> & {
@@ -6,7 +6,7 @@ import formbody from "@fastify/formbody";
6
6
  import multipart from "@fastify/multipart";
7
7
  import fastifyStatic from "@fastify/static";
8
8
  import Fastify, {} from "fastify";
9
- export async function createHttpServer({ routes, port, handlers, plugins, onWebsocket, onPlugin, onBeforeReady, onAfterReady, }) {
9
+ export async function createHttpServer({ routes, port, handlers, plugins, onWebsocket, onPlugin, onBeforeReady, onAfterReady, onAfterListen, }) {
10
10
  const fastify = Fastify({
11
11
  // https://fastify.dev/docs/latest/Reference/Server/#exposeheadroutes
12
12
  exposeHeadRoutes: true,
@@ -97,6 +97,7 @@ export async function createHttpServer({ routes, port, handlers, plugins, onWebs
97
97
  const host = "0.0.0.0";
98
98
  await fastify.listen({ port, host });
99
99
  console.log(`Listening on http://${host}:${port} ...`);
100
+ onAfterListen?.({ fastify });
100
101
  }
101
102
  catch (err) {
102
103
  fastify.log.error(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/fastify-http-server",
3
- "version": "2.0.16",
3
+ "version": "2.0.18",
4
4
  "description": "Fastify Http server",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Alexander Shagin",
@@ -17,8 +17,8 @@
17
17
  "@fastify/static": "^8.2.0",
18
18
  "@fastify/websocket": "^11.2.0",
19
19
  "fastify": "^5.5.0",
20
- "@art-ws/di": "2.0.21",
21
- "@art-ws/http-server": "2.0.13"
20
+ "@art-ws/di": "2.0.22",
21
+ "@art-ws/http-server": "2.0.15"
22
22
  },
23
23
  "devDependencies": {
24
24
  "eslint": "^9.34.0",