fix: Allow use of validations middleware in plugins
This commit is contained in:
@@ -60,8 +60,11 @@ glob
|
||||
.forEach((filePath: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pkg: Router = require(path.join(process.cwd(), filePath)).default;
|
||||
router.use("/", pkg.routes());
|
||||
Logger.debug("lifecycle", `Registered API routes for ${filePath}`);
|
||||
|
||||
if (pkg && "routes" in pkg) {
|
||||
router.use("/", pkg.routes());
|
||||
Logger.debug("lifecycle", `Registered API routes for ${filePath}`);
|
||||
}
|
||||
});
|
||||
|
||||
// routes
|
||||
|
||||
Reference in New Issue
Block a user