Skip to content

Commit 9857ef2

Browse files
author
hulutter
committed
feat(privateNpmRegistry): cleanup and comments
1 parent aec795b commit 9857ef2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

server/node-service/src/routes/apiRouter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ apiRouter.post("/runPluginQuery", pluginControllers.runPluginQuery);
1313
apiRouter.post("/getPluginDynamicConfig", pluginControllers.getDynamicDef);
1414
apiRouter.post("/validatePluginDataSourceConfig", pluginControllers.validatePluginDataSourceConfig);
1515

16-
apiRouter.get("/npm/registry/*", npmControllers.fetchRegistry);
17-
apiRouter.get("/npm/package/*", npmControllers.fetchPackageFile);
18-
16+
// routes for npm registry and package fetching with config called by the api-service
1917
apiRouter.post("/npm/registry/*", npmControllers.fetchRegistryWithConfig);
2018
apiRouter.post("/npm/package/*", npmControllers.fetchPackageFileWithConfig);
2119

20+
// temporary routes for testing npm registry and package routes by directly calling the node-service
21+
apiRouter.get("/npm/registry/*", npmControllers.fetchRegistry);
22+
apiRouter.get("/npm/package/*", npmControllers.fetchPackageFile);
23+
2224
export default apiRouter;

server/node-service/src/services/npmRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class NpmRegistryService {
7575
const config = JSON.parse(registryConfig);
7676
return NpmRegistryService.sortRegistryConfig(config);
7777
} catch (error) {
78-
console.error("Error parsing registry config", error);
78+
logger.error(`Error parsing NPM registry config: ${error}`);
7979
return [];
8080
}
8181
}

0 commit comments

Comments
 (0)