Writing a service is the same as writing a command-line program in Golf. Both take the same input and produce the same output, so you can test with either one to begin with.
For that reason, create first Hello World as a command-line program.
The only thing to do afterwards is to start up Hello World as application server:
mgrg helloCopied!
Now there's a number of resident processes running, expecting clients requests. You can see those processes:
ps -ef|grep helloCopied!
The result:
bear 25772 2311 0 13:04 ? 00:00:00 mgrg hello bear 25773 25772 0 13:04 ? 00:00:00 /var/lib/gg/bld/hello/hello.srvc bear 25774 25772 0 13:04 ? 00:00:00 /var/lib/gg/bld/hello/hello.srvc bear 25775 25772 0 13:04 ? 00:00:00 /var/lib/gg/bld/hello/hello.srvc bear 25776 25772 0 13:04 ? 00:00:00 /var/lib/gg/bld/hello/hello.srvc bear 25777 25772 0 13:04 ? 00:00:00 /var/lib/gg/bld/hello/hello.srvcCopied!
"mgrg hello" runs the Golf process manager for application "hello". A number of ".../hello.srvc" processes are server processes that will handle service request sent to application "hello".
Now, to test your service, you can send a request to the server from command line (by using "--service" option):
gg -r --req="/hello-world/name=Mike" --exec --silent-header --serviceCopied!
The above will make a request to one of the processes above, which will then reply:
This is Hello World from MikeCopied!