Installation
Note: Arecibo version 1 supports version 2 of Fastify. Arecibo version 2 supports version 3 of Fastify.
Arecibo version | Fastify version | Branch |
---|
v2 | Fastify 3 & 4 | master |
v1.1.0 | Fastify 2 | deprecated |
npm i arecibo
Usage in Node.js
const arecibo = require('arecibo')
fastify.register(arecibo, {
message: 'Put here your custom message',
readinessURL: '/put/here/your/custom/url',
livenessURL: '/put/here/your/custom/url',
readinessCallback: (req, reply) => reply.type('text/html').send('Put here your custom message'),
livenessCallback: (req, reply) => reply.type('text/html').send('Put here your custom message'),
logLevel: 'error',
})
Note for typescript users
If you set "esModuleInterop": true
you must import this module using import arecibo from 'arecibo'
.
On Kubernetes add deployment manifest
...
livenessProbe:
httpGet:
path: /arecibo/liveness
port: 80
httpHeaders:
- name: X-Custom-Header
value: Awesome
initialDelaySeconds: 15
timeoutSeconds: 1
periodSeconds: 15
readinessProbe:
httpGet:
path: /arecibo/readiness
port: 80
httpHeaders:
- name: X-Custom-Header
value: Awesome
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 15
...
How to commit
This repo uses Semantic Release with Conventional Commits.
Releases are automatically created based on the type of commit message: feat for minor and fix for patch.
feat: new feature ---> 1.x.0
fix: fix a bug ---> 1.0.x
Reference
Fun fact: where does the name come from?
The name is inspired by the Arecibo message, a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might receive and decipher it. The message was broadcast into space a single time via frequency modulated radio waves at a ceremony to mark the remodelling of the Arecibo radio telescope in Puerto Rico on 16 November 1974.