diff examples/blog/src/private/tools/backup.html.luan @ 1217:4c2972f4d862

.html in examples
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 20 Mar 2018 15:43:16 -0600
parents examples/blog/src/private/tools/backup.luan@5dbb552075ff
children 4721c482c86b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/blog/src/private/tools/backup.html.luan	Tue Mar 20 15:43:16 2018 -0600
@@ -0,0 +1,20 @@
+local Io = require "luan:Io.luan"
+local Http = require "luan:http/Http.luan"
+local Db = require "site:/lib/Db.luan"
+
+
+return function()
+	local backup = Io.uri "site:/private/local/backup.zip"
+	backup.delete()
+	Db.zip(backup)
+
+	Io.stdout = Http.response.text_writer()
+%>
+<!doctype html>
+<html>
+	<body>
+		backed up to <a href="/private/local/backup.zip">/private/local/backup.zip</a>
+	</body>
+</html>
+<%
+end