Skip to content

SonOfLawB/LuaHypertextPreProcessor-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <p>
            <lua>
                local hi = "Hello, World!"
                return _PATH .. " " .. _VERSION .. " " .. _METHOD .. " " .. _BODY .. hi;
            </lua>
        </p>
    </body>
    </html>

LHPP will execute the lua block, and replace it with the returned output.

program must be passed args like this

lhpp <path to lhpp file> <entire-request-as-string>

e.g your/user/path/test.lhpp "GET / HTTP9.9 \r\n HEADERS: BRUH \r\n body body body \r\n"

program will write processed string to stdout

LUA VARIABLES

There are 4 important global variables

_PATH - The request path

_VERSION - the request http version

_HEADERS - a lua table of request headers

_METHOD - the request method

_BODY - the body of the request

Execution Arguments

Licensed Under GPL V3

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages