From 9f173bca86bdba7635d725772e349249fa890eee Mon Sep 17 00:00:00 2001 From: amelia squires Date: Mon, 31 Mar 2025 13:21:04 -0500 Subject: typo --- docs/net.md | 14 +++++++------- src/net.c | 2 +- tests/net.lua | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/net.md b/docs/net.md index 016fe09..ca17da9 100644 --- a/docs/net.md +++ b/docs/net.md @@ -69,7 +69,7 @@ closes server 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 -it also allows for path paramaters which is a wildcard directory that pushes the results into req.paramaters (read below) +it also allows for path parameters which is a wildcard directory that pushes the results into req.parameters (read below) 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 @@ -88,7 +88,7 @@ end) ... server:GET("/home/{user}/id", function(res, req) - --sets req.paramaters.user to whatever path was requested + --sets req.parameters.user to whatever path was requested end) ``` @@ -171,15 +171,15 @@ res:sendfile("./html/index.html") ... ``` -### req.paramaters +### req.parameters -a list of paramaters for the current function +a list of parematers for the current function a path of '/user/{name}/id' and a request of '/user/amelia/id' -would set req.paramaters.name to amelia +would set req.parameters.name to amelia -currently you can not have multiple paramaters per directory +currently you can not have multiple parameters per directory > this could be changed in later versions @@ -189,7 +189,7 @@ currently you can not have multiple paramaters per directory these can, of course be used with wildcards however you want -/*/{user}/id would match /a/b/c/meow/id with req.paramaters.user being equal to meow +/*/{user}/id would match /a/b/c/meow/id with req.parameters.user being equal to meow ### req:roll diff --git a/src/net.c b/src/net.c index 32ab8dd..38e70ff 100644 --- a/src/net.c +++ b/src/net.c @@ -798,7 +798,7 @@ void* handle_client(void *_arg){ } parray_clear(par, FREE); - luaI_tsetv(L, req_idx, "paramaters", new_param_idx); + luaI_tsetv(L, req_idx, "parameters", new_param_idx); for(int z = 0; z != awa->len; z++){ char* path; diff --git a/tests/net.lua b/tests/net.lua index af66756..2470909 100644 --- a/tests/net.lua +++ b/tests/net.lua @@ -21,24 +21,24 @@ net.listen( server:POST("/{name}", function(res, req) --print("name is "..req.name) print("name") - io.pprint(req.paramaters) + io.pprint(req.parameters) res:stop() end) server:all("/{name}/nya/{user}", function(res, req) --print("name is "..req.name) print("name user") - io.pprint(req.paramaters) + io.pprint(req.parameters) end) server:all("*", function(res, req) print("all") - io.pprint(req.paramaters) + io.pprint(req.parameters) end) server:all("/{name}/user/*/{id}", function(res, req) print("owo") - io.pprint(req.paramaters) + io.pprint(req.parameters) end) -- cgit v1.2.3