Request host: [string] listen: [string] pid: [string] callback: [block]. | Manual

Request host: [string] listen: [string] pid: [string] callback: [block].

Sets up Storm Server. Storm Server is an SCGI server. Both the Request Object Plugin and Storm Server are based on S. Losen's CCGI library ( licensed LGPL. To set up a Storm Server, specify host (i.e. 'localhost'), a port to listen to (i.e. 9000) a pid file '/var/run/' and a callback block.

 Request host:'localhost' listen:4000 pid:'/var/run/' callback: {
  Pen write: 'Content-type: text/html\\n\\n'.
  var fname  := Command env: 'DOCUMENT_URI'.
  var script := File new: '/var/www/webapp'+fname.
  script include.
 Here we set up a server listening to port 4000. The callback prints out
 the content type header. Then, we extract the DOCUMENT URI, i.e. '/hello.ctr'
 and map this to a path '/var/www/webapp/hello.ctr'
 By default there is no output buffering, either create another callback or
 simply override the '<' or 'Pen' object to buffer instead of outputting

Welcome to the Citrine Online Manual Pages. This online manual has been generated automatically from source code comments using the shtml.ctr script. All Citrine documentation is also available as a UNIX manual file included in the download package. These pages are just a web version of the original Citrine Programming Language User Manual and Reference Guide.

Improve this manual

You can help to improve this manual. Any help is appreciated! If you spot an error in this manual or you want to contribute, just change the corresponding comment in the original Citrine Programming Language source code hosted on github and create a 'Pull Request'. After the documentation generation script has been invoked again the manual pages will be updated to reflect your contribution and so will these online manual pages.

About Citrine

Citrine is an easy to use programming language for everyone. Citrine is so simple it does not even need special syntax for loops or conditions. You can learn Citrine in just a couple of minutes. Citrine makes programming fun again! Visit the homepage for a quick tutorial.

back to homepage | back to manual menu | top of page