import { exit } from 'node:process'
+
import express, { type Express, type Request, type Response } from 'express'
+
import { requestHandlerPool } from './pool.js'
/**
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()
})
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) {