fastify-xconfig
xEcho()
Returns a greeting string from the X Enterprises plugin suite.
xEcho()
Returns a static greeting string. Primarily useful as a smoke-test to confirm the plugin registered successfully.
Signature
fastify.xEcho(): string
Params
xEcho() takes no arguments.
Returns
string — always "Hello from X Enterprises!"
Throws
Never throws.
Examples
Smoke test in a route
fastify.get("/ping", async () => {
return { message: fastify.xEcho() };
// { message: "Hello from X Enterprises!" }
});
Confirm registration in tests
import { test } from "node:test";
import assert from "node:assert";
import Fastify from "fastify";
import xConfig from "@xenterprises/fastify-xconfig";
test("xConfig registers xEcho", async () => {
const fastify = Fastify();
await fastify.register(xConfig);
await fastify.ready();
assert.strictEqual(fastify.xEcho(), "Hello from X Enterprises!");
});
See also
AI Context
package: "@xenterprises/fastify-xconfig"
method: fastify.xEcho()
use-when: Simple health/sanity check decorator — returns "Hello from X Enterprises!"
returns: string
