Merge pull request #2076 from poolifier/combined-prs-branch
[poolifier.git] / examples / typescript / http-server-pool / fastify-cluster / src / worker.ts
index 1551cb282ede3679ade624acb473a8ac2ab568c3..8f4442ed748d3fd2abc62c108d361aa6f565d2e6 100644 (file)
@@ -1,6 +1,8 @@
 import type { AddressInfo } from 'node:net'
-import { ClusterWorker } from 'poolifier'
+
 import Fastify, { type FastifyInstance } from 'fastify'
+import { ClusterWorker } from 'poolifier'
+
 import type { WorkerData, WorkerResponse } from './types.js'
 
 class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
@@ -36,7 +38,7 @@ class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     await FastifyWorker.fastify.listen({ port })
     return {
       status: true,
-      port: (FastifyWorker.fastify.server.address() as AddressInfo)?.port
+      port: (FastifyWorker.fastify.server.address() as AddressInfo).port
     }
   }