diff options
| author | ame <[email protected]> | 2024-02-07 15:45:26 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-07 15:45:26 -0600 |
| commit | 6c6146a89f5d4f2e615c8e97f26c896d50ff6d08 (patch) | |
| tree | d71e7a7679897a50d2b95b477d30cd41f425ef6d /docs/net.md | |
| parent | 340f17a474401563de89aa0444f7cdee209b9c35 (diff) | |
owo
Diffstat (limited to 'docs/net.md')
| -rw-r--r-- | docs/net.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/net.md b/docs/net.md index cfc064e..6387589 100644 --- a/docs/net.md +++ b/docs/net.md @@ -35,15 +35,17 @@ server:unlock() closes server
-### server:GET
+### server:GET/POST/...
'takes a string (the path) and a function to be ran in the background on request
the function has 2 arguments, the first (res) contains functions and info about resolving the request,
the second (req) contains info on the request, the path allows for wildcards, multiple get requests per path is allowed
+the actual name of the function will change based on what request method you want to accept, all requests are treated the exact same on the backend, besides HEAD requests which will also use all GET requets, and the 'all' variant will get everything
+
```lua
-server:GET("*", function(res, req, next)
+server:all("*", function(res, req, next)
if(req['Version'] ~= "HTTP/1.1") then
res:close()
end
|
