Qmining redirect routes, handling all pages, removed unecesary api code

This commit is contained in:
MrFry 2020-03-16 09:31:43 +01:00
parent cbdece54f8
commit 2caf368b95
5 changed files with 90 additions and 72 deletions

View file

@ -7,7 +7,8 @@ module.exports = {
WriteBackup: WriteBackup,
FileExists: FileExists,
CreatePath: CreatePath,
WatchFile: WatchFile
WatchFile: WatchFile,
ReadDir: ReadDir
}
var fs = require('fs')
@ -16,6 +17,10 @@ var logger = require('../utils/logger.js')
const dataFile = './public/data.json'
function ReadDir (path) {
return fs.readdirSync(path)
}
function ReadFile (name) {
if (!FileExists(name)) { throw new Error('No such file: ' + name) }
return fs.readFileSync(name, 'utf8')