import { dirname, extname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
+import { exit } from 'node:process'
import Fastify from 'fastify'
import { fastifyPoolifier } from './fastify-poolifier.js'
}
})
-fastify.all('/api/echo', async (request) => {
+fastify.all('/api/echo', async request => {
return (await fastify.execute({ body: request.body }, 'echo')).body
})
fastify.get<{
Params: { number: number }
-}>('/api/factorial/:number', async (request) => {
+}>('/api/factorial/:number', async request => {
const { number } = request.params
return (await fastify.execute({ body: { number } }, 'factorial')).body
})
await fastify.listen({ port })
} catch (err) {
fastify.log.error(err)
- process.exit(1)
+ exit(1)
}