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

12 lines
403 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) {
2022-05-25 10:26:10 +02:00
let { appId, includeRows } = ctx.query
const appName = decodeURI(ctx.query.appname)
2022-05-25 10:26:10 +02:00
includeRows = includeRows === "true"
const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt`
2021-01-29 22:52:45 +01:00
ctx.attachment(backupIdentifier)
2022-05-25 10:26:10 +02:00
ctx.body = await streamBackup(appId, includeRows)
2021-01-27 14:55:46 +01:00
}