1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00
budibase/packages/server/middleware/controllers/static.js

27 lines
801 B
JavaScript

const couchdb = require("../../db");
const fs = require("fs");
const controller = {
download: async ctx => {
// const appDatabase = couchdb.db.use(ctx.params.appId)
// appDatabase.attachment.get('rabbit', 'rabbit.png', function(err, body) {
// if (!err) {
// fs.writeFile('rabbit.png', body);
// }
// });
},
upload: async ctx => {
// const appDatabase = couchdb.db.use(ctx.params.appId)
// fs.readFile('rabbit.png', function(err, data) {
// if (!err) {
// alice.attachment.insert('rabbit', 'rabbit.png', data, 'image/png',
// { rev: '12-150985a725ec88be471921a54ce91452' }, function(err, body) {
// if (!err)
// console.log(body);
// });
// }
// });
}
}
module.exports = controller;