Calling an APIModule

34 views
Skip to first unread message

Paco S

unread,
May 23, 2014, 7:53:06 AM5/23/14
to kurog...@googlegroups.com
Hi all,

for the moment I've installed kurogo web server and all seems to be working right. Following the documentation (https://modolabs.jira.com/wiki/display/KDOC/Making+Your+First+Module+-+Hello+World) I've written a simple WebModule. Now I want to write a simple APIModule and I've added a file called HelloAPIModule.php next to HelloWebModule.php (in .../app/modules/hello/).

It looks like this:

<?php
class HelloAPIModule extends APIModule
{
    protected $id='hello';
    protected $vmin = 1;
    protected $vmax = 1;
    protected function initializeForCommand() {
        $response = array(
            'res' => $this->command
        );
        $this->setResponse($response);
        $this->setResponseVersion(1);
    }
}
?>

My question now is, how can I call this module?

If I try to call for http://localhost/hello I always get the WebModule. And if I try to remove the WebModule, nothing is found (an error is thrown).

Please, can you help me with this?

Thanks
Reply all
Reply to author
Forward
0 new messages