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