- Terminal provides maximum flexibility for backend (including
rm -rf /
) - HTML/CSS/JS provides maximum flexibility for frontend
- Install with
go get github.com/marianogappa/termserve
- Create an index.html and serve it with
termserve /path/to/index.html
<!doctype html>
<html>
<head>
<script src="http://localhost:8080/js_helper"></script>
<script>
function doEvents() {
run(`date +%s | sed 's/$/ (is the current timestamp)/'`).then(r => $("#res", r))
}
</script>
</head>
<body onLoad="setInterval(doEvents, 1000)">
<span id="res"></span>
</body>
</html>
- The
js_helper
dependency adds therun
function and a convenience$
function that doesdocument.querySelector(q).innerHTML = v
.