Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-cluster...
[poolifier.git] / examples / typescript / http-server-pool / express-worker_threads / src / main.ts
index 3bef1a8a5300855bb7a80cb08d6fca859a0d3a47..615143646507d8e2f33922426384a19e8e5e906c 100644 (file)
@@ -1,5 +1,7 @@
 import { exit } from 'node:process'
+
 import express, { type Express, type Request, type Response } from 'express'
+
 import { requestHandlerPool } from './pool.js'
 
 /**
@@ -31,7 +33,7 @@ expressApp.all('/api/echo', (req: Request, res: Response) => {
 expressApp.get('/api/factorial/:number', (req: Request, res: Response) => {
   const { number } = req.params
   requestHandlerPool
-    .execute({ body: { number: parseInt(number) } }, 'factorial')
+    .execute({ body: { number: Number.parseInt(number) } }, 'factorial')
     .then(response => {
       return res.send(response.body).end()
     })
@@ -41,7 +43,7 @@ expressApp.get('/api/factorial/:number', (req: Request, res: Response) => {
 try {
   expressApp.listen(port, () => {
     console.info(
-      `⚡️[express server]: Express server is started at http://localhost:${port}/`
+      `⚡️[express server]: Express server is started at http://localhost:${port.toString()}/`
     )
   })
 } catch (err) {