Wapp

Check-in [984d973c34]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More documentation improvements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 984d973c348166817bce9715dfcb02241ae1c0f80da35e6ec1cc8cfa5f39a5dd
User & Date: drh 2019-03-07 14:49:20
Context
2019-03-08
00:08
Add the forgotten helloworld.md documentation file. check-in: 5f79eb875f user: drh tags: trunk
2019-03-07
14:49
More documentation improvements. check-in: 984d973c34 user: drh tags: trunk
14:37
Further documentation refinements. check-in: 271766c541 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to README.md.

    18     18   -------------
    19     19   
    20     20     *  ["Hello World!" App (6 lines of code)](/doc/trunk/docs/helloworld.md)
    21     21     *  [Introduction To Writing Wapp Applications](/doc/trunk/docs/intro.md)
    22     22     *  [Quick Reference](/doc/trunk/docs/quickref.md)
    23     23     *  [Wapp Parameters](/doc/trunk/docs/params.md)
    24     24     *  [Wapp Commands](/doc/trunk/docs/commands.md)
           25  +  *  [CGI Parameters](/doc/trunk/docs/quickref.md#cgiparams)
    25     26     *  [URL Mapping](/doc/trunk/docs/urlmapping.md)
    26     27     *  [Security Features](/doc/trunk/docs/security.md)
    27     28     *  [How To Compile wapptclsh - Or Not](/doc/trunk/docs/compiling.md)
    28     29     *  [Limitations of Wapp](/doc/trunk/docs/limitations.md)
    29     30     *  [Example Applications](/file/examples)
    30     31     *  [Real-World Uses Of Wapp](/doc/trunk/docs/usageexamples.md)
    31     32     *  [Debugging Hints](/doc/trunk/docs/debughints.md)

Changes to docs/params.md.

   129    129   
   130    130   If query parameters can have side effects, then you should omit the
   131    131   wapp-allow-xorigin-params call.  Only invoke wapp-allow-xorigin-params
   132    132   for web pages that only query information.  Do not invoke
   133    133   wapp-allow-xorigin-params on pages where the parameters can be used
   134    134   to change server-side state.
   135    135   
   136         -3.0 CGI Parameter Details
          136  +<a name='cgidetail'></a>
          137  +3.0 CGI Parameter Details [(Quick reference)](quickref.md#cgiparams)
   137    138   -------------------------
   138    139   
   139    140   The CGI parameters in Wapp describe the HTTP request that is to be answered
   140    141   and the execution environment.
   141    142   These parameter look like CGI environment variables.  To prevent environment
   142    143   information from overlapping and overwriting query parameters, all the
   143    144   environment information uses upper-case names and all query parameters
................................................................................
   274    275   
   275    276   >
   276    277       http://example.com/cgi-bin/script/method/extra/path?q1=5
   277    278              \_________/\_____________/\________________/ \__/
   278    279                   |            |               |           |
   279    280               HTTP_HOST   SCRIPT_NAME      PATH_INFO       `-- QUERY_STRING
   280    281   
          282  +>
          283  +    http://example.com/cgi-bin/script/method/extra/path?q1=5
          284  +           \_________/\_______________________________/ \__/
          285  +                |                    |                   |
          286  +            HTTP_HOST         REQUEST_URI                `-- QUERY_STRING
          287  +
   281    288   >
   282    289       http://example.com/cgi-bin/script/method/extra/path?q1=5
   283    290       \_______________________________/ \____/ \________/
   284    291                       |                    |        | 
   285    292                   BASE_URL           PATH_HEAD   PATH_TAIL
   286    293   
   287    294   
   288    295   >
   289    296       http://example.com/cgi-bin/script/method/extra/path?q1=5
   290         -    \______________________________________/
   291         -                       |
   292         -                    SELF_URL
          297  +    \______________________________________/ \________/
          298  +                       |                          |
          299  +                    SELF_URL                   PATH_TAIL
   293    300   
   294    301   ### 3.2 Undefined Parameters When Using SCGI on Nginx
   295    302   
   296    303   Some of the CGI parameters are undefined by default when using CGI mode
   297    304   with Nginx.  If these CGI parameters are needed by the application, then
   298    305   values must be assigned in the Nginx configuration file.  For example:
   299    306   

Changes to docs/quickref.md.

    41     41   |**wapp-content-security-policy** _POLICY_|&rarr;|Set the CSP for the current page|
    42     42   |**wapp-debug-env**|&rarr;|Return a text description of the Wapp environment|
    43     43   |**wapp** {_TEXT_}|&rarr;|Append _TEXT_ without substitution|
    44     44   |**wapp-unsafe** _TEXT_|&rarr;|Append _TEXT_ that contains nothing that needs to be escaped|
    45     45   
    46     46   
    47     47   <a name="cgiparams"></a>
    48         -3.0 CGI Parameters
           48  +3.0 CGI Parameters [(More detail)](params.md#cgidetail)
    49     49   ------------------
    50     50   
    51     51   >
    52     52   |BASE\_URL|&rarr;|URL for the Wapp script without a method|
    53     53   |CONTENT|&rarr;|Raw (unparsed) POST content|
    54     54   |CONTENT\_LENGTH|&rarr;|Number of bytes of raw, unparsed POST content|
    55     55   |CONTENT\_TYPE|&rarr;|Mimetype of the POST content|
................................................................................
    73     73   4.0 URL Parsing
    74     74   ---------------
    75     75   
    76     76   Assuming "env.tcl" is the name of the Wapp application script:
    77     77   
    78     78   >
    79     79       https://wapp.tcl.tk/demo/env.tcl/abc/def/ghi?a=5&b=22.425#point42
    80         -            \_________/\___________/\__________/
    81         -                 |           |          |
    82         -             HTTP_HOST  SCRIPT_NAME  PATH_INFO
           80  +            \_________/\___________/\__________/ \__________/
           81  +                 |           |          |             |
           82  +             HTTP_HOST  SCRIPT_NAME  PATH_INFO    QUERY_STRING
    83     83   
    84     84   >
    85     85       https://wapp.tcl.tk/demo/env.tcl/abc/def/ghi?a=5&b=22.425#point42
    86     86       \______________________________/ \_/ \_____/
    87     87                      |                  |     |
    88         -                BASE_URL         PATH_HEAD  |-- PATH_TAIL
    89         -                                      |   __|__
    90         -                                     / \ /     \
           88  +                BASE_URL         PATH_HEAD  `-- PATH_TAIL
           89  +
           90  +>
    91     91       https://wapp.tcl.tk/demo/env.tcl/abc/def/ghi?a=5&b=22.425#point42
    92     92       \__________________________________/         \__________/
    93     93                      |                                  |
    94     94                   SELF_URL                         QUERY_STRING
    95     95   
    96     96   >
    97     97       SCRIPT_FILENAME := DOCUMENT_ROOT + SCRIPT_NAME