3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +00:00

feat: add api prefix option

This commit is contained in:
Dragory 2024-04-06 11:54:31 +00:00
parent 899f743ed6
commit b40ed5ce49
No known key found for this signature in database
9 changed files with 27 additions and 22 deletions

View file

@ -97,10 +97,10 @@ function formatZodConfigSchema(schema: z.ZodTypeAny) {
return "unknown";
}
export function initDocs(app: express.Express) {
export function initDocs(router: express.Router) {
const docsPluginNames = Object.keys(guildPluginInfo).filter((k) => guildPluginInfo[k].showInDocs);
app.get("/docs/plugins", (req: express.Request, res: express.Response) => {
router.get("/docs/plugins", (req: express.Request, res: express.Response) => {
res.json(
docsPluginNames.map((pluginName) => {
const info = guildPluginInfo[pluginName];
@ -113,7 +113,7 @@ export function initDocs(app: express.Express) {
);
});
app.get("/docs/plugins/:pluginName", (req: express.Request, res: express.Response) => {
router.get("/docs/plugins/:pluginName", (req: express.Request, res: express.Response) => {
const name = req.params.pluginName;
const baseInfo = guildPluginInfo[name];
if (!baseInfo) {