mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Qmining redirect routes, handling all pages, removed unecesary api code
This commit is contained in:
parent
cbdece54f8
commit
2caf368b95
5 changed files with 90 additions and 72 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue