mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
dataeditor api endpoints
This commit is contained in:
parent
3e4fda9974
commit
5ca0abbabf
8 changed files with 373 additions and 116 deletions
|
@ -268,7 +268,7 @@ function processIncomingRequestUsingDb(
|
|||
})
|
||||
}
|
||||
|
||||
function isQuestionValid(question: Question) {
|
||||
export function isQuestionValid(question: Question): Boolean {
|
||||
if (!question.Q) {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -619,6 +619,8 @@ if (!isMainThread) {
|
|||
// )
|
||||
} else if (msg.type === 'update') {
|
||||
qdbs = msg.qdbs
|
||||
logger.DebugLog(`Worker update ${workerIndex}`, 'worker update', 1)
|
||||
|
||||
// console.log(`[THREAD #${workerIndex}]: update`)
|
||||
} else if (msg.type === 'newdb') {
|
||||
qdbs.push(msg.newdb)
|
||||
|
|
|
@ -375,6 +375,9 @@ function C(color?: string): string {
|
|||
if (color === 'bluebg') {
|
||||
return '\x1b[44m'
|
||||
}
|
||||
if (color === 'cyanbg') {
|
||||
return '\x1b[46m'
|
||||
}
|
||||
if (color === 'green') {
|
||||
return '\x1b[32m'
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ export default {
|
|||
CopyFile,
|
||||
GetDateString,
|
||||
formatUrl,
|
||||
deleteFile: deleteFile,
|
||||
}
|
||||
|
||||
import fs from 'fs'
|
||||
|
@ -162,3 +163,11 @@ function AppendToFile(data: string, file: string): void {
|
|||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
function deleteFile(fname: string): Boolean {
|
||||
if (FileExists(fname)) {
|
||||
fs.unlinkSync(fname)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue