|
|
|
@ -5,7 +5,6 @@ import Settings, { SETTINGS_FILE, SETTINGS_FOLKS } from '../../data/Settings';
|
|
|
|
|
import Navigation from '../../data/Navigation';
|
|
|
|
|
import Book from '../../data/Book';
|
|
|
|
|
import Utils from '../../data/Utils';
|
|
|
|
|
import { util } from 'prettier';
|
|
|
|
|
const express = require('express');
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
const multer = require('multer');
|
|
|
|
@ -54,6 +53,7 @@ router.post('/sync', (req, res) => {
|
|
|
|
|
.catch(err => {
|
|
|
|
|
res.json({
|
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
|
error: err.message,
|
|
|
|
|
message: "Uh oh. Settings didn't take, sport"
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -238,23 +238,19 @@ router.post('/create-backup', (req, res) => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
router.get('/download-backup', (req, res) => {
|
|
|
|
|
var filePath = 'content/backup.zip'; // Or format the path using the `id` rest param
|
|
|
|
|
var fileName = 'backup.zip'; // The default name the browser will use
|
|
|
|
|
|
|
|
|
|
res.download(filePath, fileName);
|
|
|
|
|
//Make secure
|
|
|
|
|
/*
|
|
|
|
|
auth.authCheck(req)
|
|
|
|
|
.then(() => {
|
|
|
|
|
if (req.session.user) {
|
|
|
|
|
var filePath = 'content/backup.zip'; // Or format the path using the `id` rest param
|
|
|
|
|
var fileName = 'backup.zip'; // The default name the browser will use
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
res.json({
|
|
|
|
|
type: err.type,
|
|
|
|
|
message: err.message
|
|
|
|
|
});
|
|
|
|
|
res.download(filePath, fileName);
|
|
|
|
|
} else {
|
|
|
|
|
res.json({
|
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
|
message: "You're not logged in, champ"
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Move to route?
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
module.exports = router;
|
|
|
|
|