Skip to main content

porla_http_server

Exposes methods to interact with the embedded HTTP server in Porla.

Plugins can use this to register their own route handlers. Used by the metrics plugin to add a /metrics endpoint for Prometheus compatible metrics.

Exports​

get(path: string, callback: PoHttpServerCallback): void​

v1.0

Registers a callback handler for a HTTP GET request at the given path.

Example​

local http_server = require("porla_http_server")

http_server.get("/hello", function(req, res)
res:finish("Hello!")
end)