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.
See also
Articles
article-capi  
article-cookies  
article-debug  
article-distributed  
article-encryption  
article-fetch-web-page  
article-fifo  
article-file-manager  
article-hello-server  
article-hello-world  
article-hello-world-service  
article-hello-world-service-web  
article-how-to-create-golf-application  
article-json  
article-language  
article-mariadb  
article-memory-safety  
article-memory-safety-web  
article-notes-postgres  
article-random  
article-regex  
article-remote-call  
article-request-function  
article-security  
article-sendmail  
article-server  
article-shopping  
article-sqlite  
article-statements  
article-status-check  
article-tree  
article-tree-web  
article-vim-coloring  
article-web-framework-for-c-programming-language  
article-what-is-golf  
article-what-is-web-service  
See all
documentation


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