Mercurial Hosting > luan
comparison examples/blog/src/private/tools/backup.html.luan @ 1220:4721c482c86b
cleaner Db example
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Wed, 21 Mar 2018 15:54:57 -0600 |
| parents | 4c2972f4d862 |
| children | 82415c9c0015 |
comparison
equal
deleted
inserted
replaced
| 1219:b602badc876b | 1220:4721c482c86b |
|---|---|
| 1 local Luan = require "luan:Luan.luan" | |
| 2 local error = Luan.error | |
| 1 local Io = require "luan:Io.luan" | 3 local Io = require "luan:Io.luan" |
| 2 local Http = require "luan:http/Http.luan" | 4 local Http = require "luan:http/Http.luan" |
| 3 local Db = require "site:/lib/Db.luan" | 5 local db = require("site:/lib/Db.luan").db or error() |
| 4 | 6 |
| 5 | 7 |
| 6 return function() | 8 return function() |
| 7 local backup = Io.uri "site:/private/local/backup.zip" | 9 local backup = Io.uri "site:/private/local/backup.zip" |
| 8 backup.delete() | 10 backup.delete() |
| 9 Db.zip(backup) | 11 db.zip(backup) |
| 10 | 12 |
| 11 Io.stdout = Http.response.text_writer() | 13 Io.stdout = Http.response.text_writer() |
| 12 %> | 14 %> |
| 13 <!doctype html> | 15 <!doctype html> |
| 14 <html> | 16 <html> |
