STAXIS

staxis js platform -> gitlab project
staxis on gitlab gitlab project 🏷️ V-0.X-Beta
We’re actively updating this manual. Content and layout may change as we refine it.

httpPing

Official sources are open to Staxis GitLab group members: how to join and view the code.
Repository: httpPing development
Versions: tags and releases


Description

httpPing is a small request observer and optional HTTP pong responder built on serverApp. Its label and typology are both httpPing. Matching requests are recorded through the audit logger and normally continue to the next middleware. Use it for a request signal or a simple liveness response; healthz is the separate pack for broader service diagnostics.


Read before flight

  • We suggest selecting a signal with pingFilter when observing every request would produce unnecessary log volume. Query strings are excluded by default; enable them only when their contents are suitable for logging, especially with disk persistence.

  • We suggest using a dedicated header for native-mode probes. Query and body signals are available only after earlier middleware has populated req.query or req.body. A pong ends the matching request, so choose a signal that will not intercept normal traffic.


Requirements and Installation

The only required pack is serverApp; there are no extra npm dependencies. Install through the Manager:

                manager -> install -> httpPing
            

Place httpPing after serverApp and, when installed, httpShield, before later request handlers and httpListener. The supplied serverApp manifest already permits httpPing's pack label. Prepare the project keys and integrity records as for other runtime packs. Once attached, the middleware runs automatically; application packs do not need to request its API.


Files Map

File Purpose
manifest.json Declares the pack identity and serverApp requirement.
configs.js Provides the shared serveropt settings.
main.js Registers request detection, logging, and the optional pong response.
README.md Contains the pack reference.

Configuration

In the project's config.js, these settings belong directly to config.serveropt, without an additional httpPing object:

Setting Default Behaviour
pingsEnabletrueEnables request detection and logging during attach
pingsSavedfalseRequests disk persistence through the audit logger when true
pingFilterfalseObserves every request; an array selects signal names; an empty array matches none
pingQueriesfalseIncludes the query string in log records when true
pingPongfalseReturns a pong only for a matching signal in a nonempty filter array
pingPongMessagefalseAdds a custom message value to the pong when truthy

A signal matches by the presence of a named own property on the request, its headers, query, or body. Its value does not need to be true. Header names are matched in lowercase. httpPing does not parse the URL query or request body itself.


Example: Header Signal and Pong

Merge the following serveropt branch into the exported config object in config.js, then restart the application. The selected header triggers a log record and a JSON pong on any path that reaches httpPing.

                // config.js -> config (merge into the exported object)
                serveropt: {
                    pingsEnable: true,
                    pingsSaved: false,
                    pingFilter: ['x-staxis-ping'],
                    pingQueries: false,
                    pingPong: true,
                    pingPongMessage: 'Application reached'
                }
            
                curl -i -H "x-staxis-ping: 1" http://127.0.0.1:3000/
            

Adjust the URL to your listener. A matching request receives status 200 and a JSON body with pong=true, an ISO timestamp, process uptime in whole seconds, v-core, and the configured message. Without the header, the request continues normally. Set pingPong=false for observation only; pingFilter=false also remains observation-only, even when pingPong is true.


Log Records

Records include the socket's remote address, Host header, method, local and remote ports, and pathname. pingQueries=true additionally includes the query string. The address is the connection's peer address, so it may identify your proxy rather than the end user. pingsSaved=true passes the persistence flag to Staxis logging; leaving it false does not disable logging.


Documentation

This page is the HTML adaptation of the pack's README.md, with practical clarifications checked against the implementation. Complete Staxis onboarding to request GitLab access to the official sources.