export const config = { database: { // MONGODB IS THE BEST DATABASE url: 'mongodb://localhost:27017/yggdrasil?readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false', }, server: { port: 3000 }, signing: { // 签名材质信息使用 public: '/path/to/public.pem', private: '/path/to/private.key' }, custom: { override: { preHandler: { /* "/example/route": async function(req, rep) {} */ }, handler: { /* "/example/route": async function(req, rep) {} */ } }, preHooks: (fastify) => {}, // 在这里添加自定义hook preRouting: (fastify) => {}, // 在这里添加自定义路由 postRouting: (fastify) => {}, // IDK what u want to do at here } } export function getOverrideHandler(route) { return config.custom.override.handler[route] } export function getOverridePreHandler(route) { return config.custom.override.preHandler[route] }