repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v3.1.12
[poolifier.git]
/
examples
/
typescript
/
http-server-pool
/
fastify-worker_threads
/
src
/
main.ts
diff --git
a/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts
b/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts
index f1271c6e13566ae1b80067a178579b9a3190cb6e..724836de7ef6fb5287e511a59d5cbe71cb360c22 100644
(file)
--- a/
examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts
+++ b/
examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts
@@
-1,5
+1,6
@@
import { dirname, extname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
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'
import Fastify from 'fastify'
import { fastifyPoolifier } from './fastify-poolifier.js'
@@
-28,13
+29,13
@@
await fastify.register(fastifyPoolifier, {
}
})
}
})
-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 }
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
})
const { number } = request.params
return (await fastify.execute({ body: { number } }, 'factorial')).body
})
@@
-43,5
+44,5
@@
try {
await fastify.listen({ port })
} catch (err) {
fastify.log.error(err)
await fastify.listen({ port })
} catch (err) {
fastify.log.error(err)
-
process.
exit(1)
+ exit(1)
}
}