Détail du package

arecibo

ducktors9.9kMIT4.0.2

Fastify plugin that respondes to Kubernetes readiness and liveness probes.

kubernetes, fastify, fastify-plugin, probe

readme

--- ARECIBO --- arecibo_telescope_sending_a_signal_into_the_space_during__b5c6335a-ae52-4f9d-9350-fd7953fb5013
CI pnpm@10.4.1 NPM version NPM downloads styled with prettier Known Vulnerabilities

Installation

Note: Please refer to the table below to find the correct version of Arecibo for your Fastify version.

Arecibo version Fastify version Branch
v4 Fastify 4, 5 master
v3 Fastify 3, 4, 5 not maintained
v1.1.0 Fastify 2 deprecated
pnpm add arecibo
npm install arecibo
yarn add arecibo

Usage in Node.js

const arecibo = require('arecibo')
// or import arecibo from 'arecibo'
// or import * as arecibo from 'arecibo'

fastify.register(arecibo, {
  message: 'Put here your custom message', // optional, default to original arecibo message
  readinessURL: '/put/here/your/custom/url', // optional, deafult to /arecibo/readiness
  livenessURL: '/put/here/your/custom/url', // optional, deafult to /arecibo/liveness
  readinessCallback: (req, reply) => reply.type('text/html').send('Put here your custom message'), // optional
  livenessCallback: (req, reply) => reply.type('text/html').send('Put here your custom message'), // optional
  logLevel: 'error', // optional, defaults to 'info'; can be trace, debug, info, warn, error, and fatal
})

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.

changelog

4.0.2 (2025-04-22)

Bug Fixes

  • deps: bump fastify from 5.2.1 to 5.3.1 in the npm_and_yarn group (281ed5a)

4.0.1 (2025-02-20)

Bug Fixes

  • improve code on index.ts and update biome (2267524)

4.0.0 (2025-02-20)

Code Refactoring

  • remove support to fastify 3 and eslint (1551e25)

BREAKING CHANGES

  • Remove support to Fastify 3

3.1.1 (2025-02-19)

Bug Fixes

  • remove preinstall script (392b07f)

3.1.0 (2025-01-07)

Features

  • add support to fastift 5 (19b1f71)

3.0.1 (2024-07-31)

Bug Fixes

  • deps: bump braces from 3.0.2 to 3.0.3 in the npm_and_yarn group (02b70e8)

3.0.0 (2023-10-23)

Features

  • node: remove node16 support on pipeline and package.json (23eb74c)

BREAKING CHANGES

  • node: Remove Node v16

2.2.3 (2023-10-23)

Bug Fixes

  • node: rollaback to node 16 (0c2d28f)

2.2.2 (2023-08-03)

Bug Fixes

  • deps: bump word-wrap from 1.2.3 to 1.2.4 (b10ea28)

2.2.1 (2023-02-09)

Bug Fixes

  • deps: bump @types/node from 16.18.11 to 18.11.19 (69d1075)

2.2.0 (2023-02-01)

Features

  • update depencencies, add ci tools (99125ff)

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.8.0] - 2018-12-28

Added