Created
November 18, 2016 01:27
-
-
Save soapdog/4f35c9fc2654f62ff972a9f44611f5c5 to your computer and use it in GitHub Desktop.
trying out sample api for my little flyweb server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local server = require("flyweb_server") | |
server | |
.configure {hostname = "sample-server", port = 3030} | |
.route({path = "/"}, function(_, res) | |
res:send_static_file("index.html") | |
end) | |
.route({path = "/led", method = "POST"}, function(req, res) | |
print("POST: " .. req.POST) | |
res:send("text/plain", "you posted: " .. req.POST) | |
end) | |
.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment