This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server = one_page_server("Hello", -> <>Hello, web!</>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server = Server.simple_dispatch(_ -> | |
html("Hello", <>Hello, web!</>) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {1 Database and database interaction} | |
*/ | |
/** | |
* Contents of the wiki. | |
* | |
* Pages which do not exist have content "This page is empty". | |
* Note: By definition, pages stored in the database are always well-formed. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {1 Network infrastructure} | |
*/ | |
/** | |
* The type of messages sent by a client to the chatroom | |
*/ | |
type message = {author: string /**Arbitrary, untrusted, name*/ | |
,text: string} /**Content entered by the user*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add a path called [/storage] to the schema of our graph database. | |
* | |
* This path is is a dictionary indexed by [string]s of values | |
* of type [option(string)], i.e. values that may either be | |
* a string or omitted. To find out whether the value is present, | |
* one should use pattern-matching - case [{some: ...}] if the | |
* value is present, [{none}] if the value is omitted. | |
* | |
* Note: db is a keyword. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# {1 Database and database interaction} | |
# | |
## | |
# Contents of the wiki. | |
# | |
# Pages which do not exist have content "This page is empty". | |
# Note: By definition, pages stored in the database are always well-formed. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*{1 Network infrastructure} | |
*/ | |
/** | |
*The type of messages sent by a client to the chatroom | |
*/ | |
type message: | |
author as string //Arbitrary, untrusted, name | |
text as string //Content entered by the user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add a path called [/storage] to the schema of our graph database. | |
* | |
* This path is is a dictionary indexed by [string]s of values | |
* of type [option(string)], i.e. values that may either be | |
* a string or omitted. To find out whether the value is present, | |
* one should use pattern-matching - case [{some = ...}] if the | |
* value is present, [{none}] if the value is omitted. | |
* | |
* Note: db is a keyword. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The function defining our user interface. | |
*/ | |
start() { | |
<>Hello, web!</>; //HTML-like content. As the last value of the function, this is the result. | |
} | |
/** | |
* Create and start a server delivering user interface [start] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_server(one_page_server("Hello", -> <>Hello, web!</>)); |
OlderNewer