mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added uploaddata API for dataEditor module
This commit is contained in:
parent
105d1ee8be
commit
890998bce5
3 changed files with 80 additions and 5 deletions
|
@ -8,7 +8,8 @@ module.exports = {
|
|||
FileExists: FileExists,
|
||||
CreatePath: CreatePath,
|
||||
WatchFile: WatchFile,
|
||||
ReadDir: ReadDir
|
||||
ReadDir: ReadDir,
|
||||
CopyFile: CopyFile
|
||||
}
|
||||
|
||||
var fs = require('fs')
|
||||
|
@ -17,6 +18,11 @@ var logger = require('../utils/logger.js')
|
|||
|
||||
const dataFile = './public/data.json'
|
||||
|
||||
function CopyFile (from, to) {
|
||||
CreatePath(to)
|
||||
fs.copyFileSync(from, to)
|
||||
}
|
||||
|
||||
function ReadDir (path) {
|
||||
return fs.readdirSync(path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue