Check-in [3bb6b9ecdb]

Not logged in

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

Overview
Comment:Added an index page to the server, so you can browse http://localhost:4001 and get nice links to the examples.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3bb6b9ecdb0269369292d2181829a61810ebfcc9
User & Date: andy 2015-05-01 09:12:37
Context
2015-05-07
09:54
Updated presentation: final version. Leaf check-in: a01b5086af user: andy tags: trunk
2015-05-01
09:12
Added an index page to the server, so you can browse http://localhost:4001 and get nice links to the examples. check-in: 3bb6b9ecdb user: andy tags: trunk
2015-04-30
07:06
Updated flyer with presentation location. check-in: 855f5cd0f0 user: andy tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added examples/index.html.

            1  +<!DOCTYPE html>
            2  +<html>
            3  +  <head>
            4  +    <meta charset="utf-8">
            5  +    <title>Arend &mdash; Samples</title>
            6  +    <style type="text/css">
            7  +      body {
            8  +        font-family: sans-serif;
            9  +        width: 600px;
           10  +        margin-left: auto;
           11  +        margin-right: auto;
           12  +      }
           13  +    </style>
           14  +  </head>
           15  +  <body>
           16  +    <h1>Arend samples</h1>
           17  +
           18  +    <p><a href="examples/repl.html">Run-Eval-Print loop</a></p>
           19  +
           20  +    <p><a href="examples/proof-mockup.html">Proof assistant demo</a></p>
           21  +  </body>
           22  +</html>

Changes to server.pl.

    51     51   
    52     52   :- http_handler(root(src), serve_files_in_directory(src), [prefix]).
    53     53   :- http_handler(root(res), serve_files_in_directory(res), [prefix]).
    54     54   :- http_handler(root(lib), serve_files_in_directory(lib), [prefix]).
    55     55   :- http_handler(root(examples), serve_files_in_directory(examples), [prefix]).
    56     56   
    57     57   % Simple index handler, so that I don't have to stare at a 404 on startup.
    58         -%:- http_handler('/index.html', show_index, []).
           58  +:- http_handler(root('.'), http_reply_file(examples('index.html'),[]), []).
           59  +:- http_handler(root('index.html'), http_reply_file(examples('index.html'),[]), []).
    59     60   
    60     61   
    61     62   % server(), server(Port)
    62     63   % Start the Arend server on the specified port (defaults to 4001).
    63     64   start :- server(4001).
    64     65   server(Port) :-
    65     66         http_server(http_dispatch, [port(Port)]).