fastify-xconfig
xConfig.echo()
Returns a greeting string from the X Enterprises plugin suite.
xConfig.echo()
Returns a static greeting string. Primarily useful as a smoke-test to confirm the plugin registered successfully.
Signature
fastify.xConfig.echo(): string
Params
xConfig.echo() 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.xConfig.echo() };
// { 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 the xConfig namespace", async () => {
const fastify = Fastify();
await fastify.register(xConfig);
await fastify.ready();
assert.strictEqual(fastify.xConfig.echo(), "Hello from X Enterprises!");
});
See also
AI Context
package: "@xenterprises/fastify-xconfig"
method: fastify.xConfig.echo()
use-when: Simple health/sanity check decorator — returns "Hello from X Enterprises!"
returns: string
