Wapp

Artifact [0e7eb48ca6]
Login

Artifact 0e7eb48ca6c03d3270c1c8bf56f4954641b969c44e870585257baf4bb88462d0:


Hello World
===========

Here is a "Hello, World!" web application written using W3:

>
    #!/usr/bin/tclsh
    package require w3
    proc w3-default {} {
      w3-subst {<h1>Hello, World!</h1>\n}
    }
    w3-start $argv

To run this application using the built-in web-server, store the code above
in a file (here we use the name "hello.tcl") and do:

>
    tclsh hello.tcl

To run the app using the built-in web-server bound to all TCP addresses
and listening on port 8080, use:

>
    tclsh hello.tcl --server 8080

To run the app as an SCGI server listening on port 9001:

>
    tclsh hello.tcl --scgi 9001

To run the application as CGI, make the hello.tcl file executable and
move it into the appropriate directory of the web server.

Further Information
-------------------

  *  [Introduction To Writing W3 Applications](/doc/trunk/docs/intro.md)
  *  [Quick Reference](/doc/trunk/docs/quickref.md)
  *  [W3 Parameters](/doc/trunk/docs/params.md)
  *  [W3 Commands](/doc/trunk/docs/commands.md)
  *  [URL Mapping](/doc/trunk/docs/urlmapping.md)
  *  [Security Features](/doc/trunk/docs/security.md)
  *  [How To Compile w3tclsh - Or Not](/doc/trunk/docs/compiling.md)
  *  [Limitations of W3](/doc/trunk/docs/limitations.md)
  *  [Example Applications](/file/examples)
  *  [Real-World Uses Of W3](/doc/trunk/docs/usageexamples.md)
  *  [Debugging Hints](/doc/trunk/docs/debughints.md)