diff options
| author | ame <[email protected]> | 2024-08-03 02:30:02 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-08-03 02:30:02 -0500 |
| commit | 37dc46c19843f3328e06c7199548238f056c1a6b (patch) | |
| tree | cbfee9fffc70d07bfd6b632e1f73b17da19d578c /readme.md | |
| parent | 3aaf4185c489830ff6c56c9a359584d5003f92ec (diff) | |
fix tests, module based require, thread improvments
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -7,16 +7,18 @@ heres an example of a webserver to return a [sha0](https://en.wikipedia.org/wiki <blockquote>
```lua
-llib = require "lullaby"
+--(this is in tests/net2.lua)
+net = require "lullaby.net"
+crypto = require "lullaby.crypto"
local port = 8080
MAX_LENGTH = 2048
-llib.net.listen(function(server)
+net.listen(function(server)
--listen to post requests at localhost:8080 (root directory)
server:POST("/", function(res, req)
--creates a sha0 hash object
- local hash = llib.crypto.sha0()
+ local hash = crypto.sha0()
--loads an extra 2048 characters from the request body (the body is not guaranteed to be >= 2048 characters, reasoning in docs)
req:roll(MAX_LENGTH)
|
