Cache as a web service


This example shows Apache as the front-end (or "reverse proxy") for article-tree - it's assumed you've completed it first. Three steps to setting up Apache quickly:
  1. Enable FastCGI proxy used to communicate with Golf services - this is one time only:
  2. Edit Apache configuration file:
    Add this to the end of the configuration file - note "tree" is the application name you created in the above example (replace "your-user" with your OS user name):
    ProxyPass "/tree/" unix:///home/your-user/.golf/apps/tree/sock/.sock|fcgi://localhost/tree

  3. Restart Apache.
- Test web service

Now you can call your web service, from the web. In this case it's probably a local server (127.0.0.1) if you're doing this on your own computer. The URLs would be, for example to add, query and delete a key/value pair:
http://127.0.0.1/tree/srv/op=add/key=1/data=d_1

http://127.0.0.1/tree/srv/op=query/key=1

http://127.0.0.1/tree/srv/op=delete/key=1

Note the URL request structure: first comes the application path ("/tree") followed by request path ("/srv") followed by URL parameters (such as "/op=add/key=1/data=d_1"). The result in web browser are messages informing you that the key was added, queried or deleted.


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.