Last active
January 8, 2022 17:23
-
-
Save cirocosta/ccd317490f9e9c0ade878e89ea8591ab to your computer and use it in GitHub Desktop.
Returns a 200OK as a status check (haproxy)
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
status = {} | |
status.version = "0.0.1" | |
status.startup = function() | |
core.Info("[status] status script v" .. status.version); | |
end | |
status.run = function(applet) | |
local response = "200 OK" | |
local response_length = string.len(response) | |
applet:set_status(200) | |
applet:add_header("Content-Length", response_length) | |
applet:add_header("Content-Type", "text/plain") | |
applet:start_response() | |
applet:send(response) | |
end | |
core.register_init(status.startup) | |
core.register_service("status", "http", status.run) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment