@lark-apaas/devtool-kits 1.2.17-alpha.15 → 1.2.17-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3341,8 +3341,9 @@ function groupRoutesByModule(routes) {
|
|
|
3341
3341
|
return groups.sort((a, b) => a.name.localeCompare(b.name));
|
|
3342
3342
|
}
|
|
3343
3343
|
__name(groupRoutesByModule, "groupRoutesByModule");
|
|
3344
|
-
async function fetchRoutesFromBackend() {
|
|
3345
|
-
const
|
|
3344
|
+
async function fetchRoutesFromBackend(basePath) {
|
|
3345
|
+
const normalizedBasePath = basePath.replace(/\/+$/, "");
|
|
3346
|
+
const url = `http://localhost:${SERVER_PORT}${normalizedBasePath}/api/__framework__/debug`;
|
|
3346
3347
|
const response = await fetch(url, {
|
|
3347
3348
|
method: "GET",
|
|
3348
3349
|
headers: {
|
|
@@ -3374,7 +3375,8 @@ function createApiListHandler() {
|
|
|
3374
3375
|
res.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
|
3375
3376
|
res.header("Access-Control-Allow-Headers", "Content-Type, Accept");
|
|
3376
3377
|
try {
|
|
3377
|
-
const
|
|
3378
|
+
const basePath = process.env.CLIENT_BASE_PATH || "";
|
|
3379
|
+
const routes = await fetchRoutesFromBackend(basePath);
|
|
3378
3380
|
const groups = groupRoutesByModule(routes);
|
|
3379
3381
|
res.json({
|
|
3380
3382
|
groups,
|