Created
January 5, 2025 00:31
-
-
Save keb/9c429b381e908136de8b00532e1229e4 to your computer and use it in GitHub Desktop.
fullmoon example
This file contains 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 moon = require 'lib.fullmoon' | |
moon.setRoute({'/:username', method = 'GET'}, function (r) | |
local username = r.params.username | |
return 'Profile page for: ' .. username | |
end) | |
moon.setRoute({'/register', method = 'POST'}, function (r) | |
local username = r.params.username | |
moon.logDebug(username) -- this always logs "register" | |
return 'Post endpoint: ' .. username | |
end) | |
moon.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment