0

I have developed a MarkLogic application which is neither an MVC nor a REST application (more precisely, it is a REST API which doesn't use the standard ML REST API).

I'd like to use Roxy to package and deploy this application but Roxy includes either ML's REST API or MVC framework when you create a new project.

Is it possible to strip down what is deployed by Roxy or do I have to find other solutions such as MarkLogic packaging which is much less features complete than Roxy?

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

3 Answers3

4

To use the Deployer for a non-MarkLogic REST API application, I would start with an mvc application (ml new my-app --app-type=mvc), remove the provided source code (rm -rf src), then reset the URL rewriter and error handler

  • url-rewriter=
  • error-handler=

Then you can copy your code into src.

-- Update --

As grtjn has noted, this ticket was implemented in Roxy. Correct answer is now to use --app-type=bare.

Dave Cassel
  • 8,352
  • 20
  • 38
  • It's working fine (I still have an error to fix probably due to a difference in the resulting HTTP server or database but this is probably not related to this question), thanks! What about adding a new "raw" or "generic" type of application to Roxy which would be less misleading and avoid to have to delete things? – Eric van der Vlist Feb 02 '15 at 20:22
  • I invite you to make that suggestion over on [GitHub](https://github.com/marklogic/roxy/issues). There have been other cases where that would be useful. – Dave Cassel Feb 02 '15 at 20:41
  • 1
    This is done ([issue #362](https://github.com/marklogic/roxy/issues/362)). Thanks. – Eric van der Vlist Feb 02 '15 at 21:30
2

If you create a new Roxy project using the REST-type, you will notice that the src folder is empty, and the rest-api folder won't contain much either. If you are willing to ignore the rest-api folder, and rework a few settings in build.properties to match your own rewriter and such, then there is not much holding you back to deploy most kinds of MarkLogic applications.

You can also use deploy src instead of deploy modules to make it skip the deployment or the REST options and extensions.

HTH!

grtjn
  • 20,254
  • 1
  • 24
  • 35
  • I have tried both your approach (rest type) and Dave Cassel's approach (mvc type) and both work but with rest type `ml deploy modules` raises warning complaining that REST stuff are missing. I am thus led to prefer starting from a mvc type... Thanks anyway! – Eric van der Vlist Feb 02 '15 at 20:18
  • Hence the suggestion to use `deploy src` instead. The error wouldn't be harmful by the way, but it doesn't look nice. We'll certainly look into adding a generic app-type to Roxy.. – grtjn Feb 03 '15 at 16:10
0

As suggested in the comments on Dave's answer, a new Roxy app type has been introduced. You can now use:

ml new my-app --app-type=bare

That give amongst others an empty src folder, no rest-api, and no rewriter..

HTH!

grtjn
  • 20,254
  • 1
  • 24
  • 35