Here are a few examples of simple or dummy servers written using nanoserv, all of them can be run from the command line.

Click on the filename to view the highlighted source code.


dumb_xmlrpc_server.php

<?php

require "nanoserv/handlers/HTTP/XML_RPC/Direct_Server.php";

class 
dumb_xmlrpc_httpd extends \Nanoserv\HTTP\XML_RPC\Direct_Server {

    public function 
getFoo($bar) {

        return array(
"foo" => $bar);

    }

}

\
Nanoserv\Core::New_Listener("tcp://0.0.0.0:800""dumb_xmlrpc_httpd")->Activate();
\
Nanoserv\Core::Run();

?>