+import { exit } from 'node:process'
+
import express, { type Express, type Request, type Response } from 'express'
+
import { requestHandlerPool } from './pool.js'
/**
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)
const { number } = req.params
requestHandlerPool
.execute({ body: { number: parseInt(number) } }, 'factorial')
- .then((response) => {
+ .then(response => {
return res.send(response.body).end()
})
.catch(emptyFunction)
})
} catch (err) {
console.error(err)
- process.exit(1)
+ exit(1)
}