budibase/packages/server/src/api/controllers/backup.js

10 lines
339 B
JavaScript
Raw Normal View History

const { streamBackup } = require("../../utilities/fileSystem")
2021-01-27 14:55:46 +01:00
2021-05-03 09:31:09 +02:00
exports.exportAppDump = async function (ctx) {
2021-02-05 11:55:54 +01:00
const { appId } = ctx.query
const appName = decodeURI(ctx.query.appname)
const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt`
2021-01-29 22:52:45 +01:00
ctx.attachment(backupIdentifier)
ctx.body = await streamBackup(appId)
2021-01-27 14:55:46 +01:00
}