view website/src/examples/sse_push.html.luan @ 1829:0eb615de1f80

add mail helo
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 22 Sep 2024 20:05:54 -0600
parents 3e9f26404433
children
line wrap: on
line source

local Io = require "luan:Io.luan"
local Http = require "luan:http/Http.luan"


return function()
	local request = Http.request
	local message = request.parameters.message
	if message ~= nil then
		local url = request.url()
		Http.push(url,message)
	end
	Io.stdout = Http.response.text_writer()
%>
<!doctype html>
<html>
	<body>
		<h1>push server-sent events</h1>
		<form method=post>
			<p><textarea name=message></textarea></p>
			<p><input type=submit></p>
		</form>
	</body>
</html>
<%
end