Thanks David and Erik,

I have updated roxy routes in app config with the below code and is working
as expected. Now i can enhance it to authorize based on the header token
value that that match with the one in db.

Code snippet:
declare variable $c:ROXY-ROUTES :=
  <routes xmlns="http://marklogic.com/appservices/rest";>
    <request uri="^/sample(/?)$" endpoint="/sample/index.html"/>
    <request uri="^/$" endpoint="/sample/index.html"/>
    <request uri="^/(css|js|images)/(.*)" endpoint="/sample/$1/$2"/>
    {
      if(common:check-for-header()) then
        $def:ROXY-ROUTES/rest:request
      else ()
    }
  </routes>;

I also tried this without roxy and it worked fine for application sample
uri but didn't work for REST API. when tried calling REST endpoints it was
saying empty string as my request and endpoint were not correct. If there
is a way that we can achieve this without roxy kindly let me know.

Thanks & Regards,
Rajesh Kumar P
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to