Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Problem switching from app-type=rest to app-type=hybrid #477

Closed
dmcassel opened this issue Jun 30, 2015 · 5 comments
Closed

Problem switching from app-type=rest to app-type=hybrid #477

dmcassel opened this issue Jun 30, 2015 · 5 comments

Comments

@dmcassel
Copy link
Collaborator

A Roxy user sent me this question:

I wanted to know what is the proper way to convert my Roxy configuration from "app-type=mvc" to "app-type=hybrid" while also using my custom url rewriter code.

My current Roxy configuration is as follows (using my own custom url rewriter):

app-type=mvc
rewrite-resolves-globally=
url-rewriter=rewrite.xqy

I changed my Roxy configuration to hybrid (I want to use the MarkLogic REST APIs) using the same HTTP App Server to the following (still using my custom url rewriter):

app-type=hybrid
rewrite-resolves-globally=true
url-rewriter=rewrite.xqy

The above changes did not work. I noticed that if I download Roxy from github and configure it for hybrid there is a directory that is created "rest-api" which does not exist in my current Roxy directory

git clone git://github.com/marklogic/roxy.git
ml init new-project --server-version=7 --app-type=hybrid

Obviously I am doing something wrong here. I wanted to know what is the proper way of doing this.

@dmcassel
Copy link
Collaborator Author

The rest-api directory that gets created for hybrid and rest applications holds configuration for the REST API, as well as extensions and transforms. The simplest way to add that is to use "ml new" or "ml init" with a hybrid or rest project, then copy that directory over.

For your custom rewriter, see lines 40-50 of the built-in rewriter. The provided rewriter starts by trying to rewrite the URL the Roxy way; if the URL is unchanged from that, it runs it through the MarkLogic REST API rewriter. If you add that section to your custom rewriter, you should be fine.

Be advised that the rewriting mechanism in MarkLogic 8 is completely different -- you will probably need to reimplement your rewriter when you go to ML8.

@grtjn
Copy link
Contributor

grtjn commented Jun 30, 2015

Worth a wiki page?

@grtjn
Copy link
Contributor

grtjn commented Jun 30, 2015

In reply to the original message: properties were changed correctly from the looks of it, but not sure if the user did a bootstrap. That is necessary to get the rewrite-resolves-globally setting into the app server, and that is necessary to be able to run the REST api endpoints (of which the code resides in the Modules folder on filesys)..

@dmcassel
Copy link
Collaborator Author

I propose closing this one. Any objections?

@grtjn
Copy link
Contributor

grtjn commented Jun 14, 2017

I created this wiki page which covers differences is sufficient detail to allow people to manually transition:

https://github.com/marklogic/roxy/wiki/Available-Application-Types#differences-between-types

@grtjn grtjn closed this as completed Jun 14, 2017
@grtjn grtjn assigned grtjn and unassigned dmcassel Jun 14, 2017
@grtjn grtjn added this to the July 2017 milestone Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants