Added swagger ui

This commit is contained in:
SamTV12345 2024-09-15 13:54:09 +02:00
parent 644cb9b39f
commit 4d5230cf9c
5 changed files with 533 additions and 35 deletions

View file

@ -12,6 +12,7 @@ const webaccess = require('./webaccess');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
import {build, buildSync} from 'esbuild'
import {ArgsExpressType} from "../../types/ArgsExpressType";
let ioI: { sockets: { sockets: any[]; }; } | null = null
exports.socketio = (hookName: string, {io}: any) => {
@ -19,7 +20,7 @@ exports.socketio = (hookName: string, {io}: any) => {
}
exports.expressPreSession = async (hookName:string, {app}:any) => {
exports.expressPreSession = async (hookName:string, {app}:ArgsExpressType) => {
// This endpoint is intended to conform to:
// https://www.ietf.org/archive/id/draft-inadarei-api-health-check-06.html
app.get('/health', (req:any, res:any) => {
@ -243,7 +244,7 @@ const convertTypescriptWatched = (content: string, cb: (output:string, hash: str
})
}
exports.expressCreateServer = async (hookName: string, args: any, cb: Function) => {
exports.expressCreateServer = async (hookName: string, args: ArgsExpressType, cb: Function) => {
const padString = eejs.require('ep_etherpad-lite/templates/padBootstrap.js', {
pluginModules: (() => {
const pluginModules = new Set();
@ -369,4 +370,8 @@ exports.expressCreateServer = async (hookName: string, args: any, cb: Function)
// express-session automatically calls req.session.touch() so we don't need to do it here.
res.json({status: 'ok'});
});
};