Created
August 26, 2016 20:13
-
-
Save eballisty/ce8c1beb889e0d6adf0079d52a85ba0f to your computer and use it in GitHub Desktop.
Register Method with Mura's API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void function onSiteRequestStart(required struct $) output=false { | |
var APIUtility = $.siteConfig().getApi('json', 'v1'); | |
var Service = $.getBean('MyService'); | |
APIUtility.registerMethod('getData', Service.getData); | |
// then call the method via this url: | |
// /index.cfm/_api/json/v1/site_id/?method=getData | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment