Friday, 20 January 2012

Rebol as web application

The power of Rebol can be used also for web application. There are many languages for this purpose: PHP, Javascript, Ruby. But no other language is easy, complete and small as Rebol.
To install on a webserver you must download the rebol core version from here (just 300kb):
http://www.rebol.com/download-core.html
Then you can copy in your webserver, for example in /usr/bin/.
To use it you webserver must be configured to use CGI script (all webserver usually permit CGI scripts).
Now You are ready to write your first web application, like this: (call it example.cgi)
#! /usr /bin /rebol-core -cs
Rebol [ title: "My first example" ]
print "Content-type: text/html^/"
print [ "REBOL CGI works!" "Time is: " now/time]


Now connect to your webserver, like www.myweb.com/example.cgi, and it'll appear on your browser like this:



The first 3 rows are mandatory:
  1. path to rebol core with option for CGI scripts
  2. Rebol header (rebol want it)
  3. HTML header (all webservers want it)
 You may discover further on Rebol CGI reading these pages:
 There are a lot of script ready to use for webserver, here a small list:

1 comment:

  1. If we use windows 7 as the OS not Linux, what need to be changed to line 1?
    1. Path to rebol core with option for CGI scripts
    2. Rebol header (rebol want it)
    3. HTML header (all webservers want it)

    ReplyDelete