annotate examples/blog/src/private/tools/backup.html.luan @ 1304:5b947f29ea87 0.23

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 13 Jan 2019 18:22:14 -0700
parents 4721c482c86b
children 82415c9c0015
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1220
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
1 local Luan = require "luan:Luan.luan"
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
2 local error = Luan.error
693
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 597
diff changeset
3 local Io = require "luan:Io.luan"
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 597
diff changeset
4 local Http = require "luan:http/Http.luan"
1220
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
5 local db = require("site:/lib/Db.luan").db or error()
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 return function()
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 local backup = Io.uri "site:/private/local/backup.zip"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 backup.delete()
1220
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
11 db.zip(backup)
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 Io.stdout = Http.response.text_writer()
1216
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
14 %>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
15 <!doctype html>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
16 <html>
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 <body>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 backed up to <a href="/private/local/backup.zip">/private/local/backup.zip</a>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 </body>
1216
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
20 </html>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
21 <%
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 end