0

I've been playing with the REST functionality in Railo 4, with limited success...

I have two paths set up, the first works exactly as I'd expect but requests to the second seem to exist outside of the application...

I have two mappings: /api and /admin/api

I created /admin/api first, I'm not sure if that makes a difference, but everything is working fine there and not in /api.

I have the following components in both:

<cffunction
    name="test"
    access="remote"
    returntype="struct"
    returnformat="json"
    output="true"
    httpmethod="GET"
    >

    <cfscript>
        return Application;
    </cfscript>

</cffunction>

In my application I have a bunch of variables that are created onApplicationStart - if I run this component from /admin/api they are all available to me, however running the exact same component from /api I don't have any!

I set up the /admin/api a while ago and have had it functioning with no problems - I'm wondering if I've missed a step when I set up /api... Can anyone explain why I would have access to the application variables in one path, but not in the other?

Gary Stanton
  • 1,435
  • 12
  • 28
  • Where is the `Application.cfc` file in relation to your physical directories? – Miguel-F Jul 09 '13 at 17:45
  • The Application.cfc is in the web root. I'm setting up the rest mappings manually in Railo admin. After a fair bit of messing about, I've found that it works fine as long as the CFCs are located at least 2 folders deep anywhere in the filestructure! AJ has been doing some testing with me and managed to get it working mostly as expected, but I can't figure out what causes the issue. – Gary Stanton Jul 09 '13 at 19:52

0 Answers0