lsp-yggdrasil/src/config.js

54 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,
skinDomain: [ "assets.lama.icu" ],
serverName: "老色批世界树",
advanced: { // 详情可见 -> https://github.com/yushijinhun/authlib-injector/wiki/Yggdrasil-%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%8A%80%E6%9C%AF%E8%A7%84%E8%8C%83#meta-%E4%B8%AD%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE
links: {
homepage: "",
register: ""
},
"feature.non_email_login": false,
"feature.legacy_skin_api": false,
"feature.no_mojang_namespace": false,
"feature.enable_mojang_anti_features": false,
"feature.enable_profile_key": false
}
},
signing: { // 签名材质信息使用
public: 'public.pem',
private: 'private.key'
},
custom: {
override: { // 使用这个来覆写一个路径的处理器使用function而不是箭头函数可以用this访问fastify server
preHandler: {
/*
"/example/route": async function(req, rep) {}
*/
},
handler: {
/*
"/example/route": async function(req, rep) {}
*/
}
},
preHooks: (fastify) => {}, // 在这里添加自定义hook
preRouting: (fastify) => {}, // 在这里添加自定义路由
postRouting: (fastify) => {}, // 我也不知道你在这里写了有啥用...
},
telegram: {
token: '5161996862:AAHY79HdmI9A9Xoumv4E8hzi5UUrY38n5h0',
}
}
export function getOverrideHandler(route) {
return config.custom.override.handler[route]
}
export function getOverridePreHandler(route) {
return config.custom.override.preHandler[route]
}