Added global variables in sitefiles to allow for https support

This commit is contained in:
Nate Choe
2022-01-29 13:21:35 -06:00
parent db645b0bf5
commit c46ed581c3
18 changed files with 430 additions and 58 deletions

View File

@@ -11,14 +11,23 @@ sitefiles also allow comments with #
# Part 2: Commands
* ```set [variable] [value]``` - sets some variable for the following pages
* ```set [variable] [value]``` - sets some local variable for the following pages
* ```define [variable] [value]``` - sets some global variable
* ```read [http path] [file path]``` - if the requested path matches ```[http path]```, return the contents of ```[file path]```. If [file path] is a directory, then the http path is appended to [file path] and that is read instead.
##### Other than set, commands should take in a regex as argument 1 and operate on a file specified in argument 2.
# Part 3: Variables
# Part 3: Local variables
* ```respondto```: - The type of http request to respond to. One of:
* ```respondto``` - The type of http request to respond to. One of:
* GET (defualt)
* POST
* ```host```: - The hostname to respond to. Case insensitive, default: localhost
* ```host``` - The hostname to respond to. Case insensitive, default: localhost
# Part 4: Global variables
* ```transport``` - the type of connection to use. One of:
* TCP (default)
* TLS
* ```key``` - The filepath of the private key to use if transport == TLS
* ```cert``` - The filepath of the certificate to use if transport == TLS