1

MarkLogic 版本:9.0-6.2

我需要为自定义 REST API 构建端点 URL,如下所示。

https://localhost:8011/v1/resources/customer/registration/preference

所以我创建了如下所示的文件夹结构

\plugins\entities\Customer\harmonize\REST\services\customer\registration

在“注册”文件夹中,我放置了preference.sjs 文件。当我调用该服务时,我收到405:Method not found错误。

但是,如果我将相同的确切代码(preference.sjs)放在

\plugins\entities\Customer\harmonize\REST\services\ 

并使用 URL https://localhost:8011/v1/resources/preference然后我得到预期的结果。

有关如何构建文件夹以支持所需 URL 的任何指示?

4

1 回答 1

2

我不相信REST API Resource Service Extensions支持目录。

您可以使用分隔符(例如-extensionName目录中代替目录)来组织扩展名并确保它们在排序时被分组:

\plugins\entities\Customer\harmonize\REST\services\customer-registration-preferences.sjs
于 2018-10-19T14:26:21.567 回答