首页 > 解决方案 > 更改 localhost:9002 以公开 API

问题描述

我正在尝试让 api 在 Azure VM 上运行。该网址将不再存在https://localhost:9002/rest/v2/ext/basestores/ext,但是otherUrl:9002/rest/v2/ext/basestores/ext.

有人能告诉我在哪里找那个吗?

非常感谢 :)

标签: hybrisspartacus-storefront

解决方案


不确定我是否正确地回答了您的问题,但至少从斯巴达克斯的角度来看,您可以backend.occ.baseUrl为您需要的任何 URL 定义配置。

这是基本示例:

B2cStorefrontModule.withConfig({
   backend: {
     occ: {
       baseUrl: 'https://localhost:9002',
       prefix: '/rest/v2/'
     }
   },
 }),

以下是如何设置 Spartacus 的文档: https ://sap.github.io/cloud-commerce-spartacus-storefront-docs/building-the-spartacus-storefront-from-libraries/#adding-import-declarations-和店面配置设置


推荐阅读