Skip to content

Instantly share code, notes, and snippets.

@soapdog
Created November 18, 2016 01:27
Show Gist options
  • Save soapdog/4f35c9fc2654f62ff972a9f44611f5c5 to your computer and use it in GitHub Desktop.
Save soapdog/4f35c9fc2654f62ff972a9f44611f5c5 to your computer and use it in GitHub Desktop.
trying out sample api for my little flyweb server
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