dynamically import routes

This commit is contained in:
Arthur Lu
2023-08-07 18:48:47 +00:00
parent 0232b2208e
commit 212d9721f8
3 changed files with 30 additions and 34 deletions

View File

@@ -16,17 +16,7 @@ const vmidRegexP = "\\d+";
const basePath = `/:node(${nodeRegexP})/:type(${typeRegexP})/:vmid(${vmidRegexP})`;
import("./cluster/disk.js").then((module) => {
router.use(`${basePath}/disk`, module.router);
});
import("./cluster/net.js").then((module) => {
router.use(`${basePath}/net`, module.router);
});
import("./cluster/pci.js").then((module) => {
router.use(`${basePath}/pci`, module.router);
});
global.utils.recursiveImport(router, basePath, "cluster", import.meta.url);
/**
* GET - get available pcie devices given node and user