"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.requestIdPlugin = void 0;
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
exports.requestIdPlugin = (0, fastify_plugin_1.default)(async (app) => {
    app.addHook("onSend", async (req, reply, payload) => {
        reply.header("X-Request-Id", req.id);
        return payload;
    });
});
exports.default = exports.requestIdPlugin;
