1

I want to create custom REST endpoint in MarkLogic, like "http://localhost:port/v1/resources/my_custom_endpoint"

And I am doing it via curl command in my local. But I want to integrate this with ml-gradle to automate this process as first install activity.

Please let me know how to do it via ml-gradle.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
anuj_gupta
  • 131
  • 4

1 Answers1

0

As explained in this other answer, you need to put your custom REST endpoint module in your project /src/main/ml-modules/services directory.

You can see an example of how to configure a custom REST endpoint in the ml-gradle sample project in which it explains:

  • /services contains custom services, exposed via /v1/resources/(name of service)

In addition, the rest-properties.json file in the root of this directory is used to configure the properties of the REST API server. Note that these properties are different from the configuration of the server itself - the properties are specific to the REST API out-of-the-box endpoints.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147