Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/express-worker_thr...
[poolifier.git] / examples / typescript / http-server-pool / express-worker_threads / src / main.ts
index 970cf4d0d52f9f8bd78f47d19e5b89d4ba61f047..3bef1a8a5300855bb7a80cb08d6fca859a0d3a47 100644 (file)
@@ -1,3 +1,4 @@
+import { exit } from 'node:process'
 import express, { type Express, type Request, type Response } from 'express'
 import { requestHandlerPool } from './pool.js'
 
@@ -21,7 +22,7 @@ expressApp.use(express.json())
 expressApp.all('/api/echo', (req: Request, res: Response) => {
   requestHandlerPool
     .execute({ body: req.body }, 'echo')
-    .then((response) => {
+    .then(response => {
       return res.send(response.body).end()
     })
     .catch(emptyFunction)
@@ -31,7 +32,7 @@ expressApp.get('/api/factorial/:number', (req: Request, res: Response) => {
   const { number } = req.params
   requestHandlerPool
     .execute({ body: { number: parseInt(number) } }, 'factorial')
-    .then((response) => {
+    .then(response => {
       return res.send(response.body).end()
     })
     .catch(emptyFunction)
@@ -45,5 +46,5 @@ try {
   })
 } catch (err) {
   console.error(err)
-  process.exit(1)
+  exit(1)
 }