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:
parent
899f743ed6
commit
b40ed5ce49
9 changed files with 27 additions and 22 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue