Merge branch 'master' of gitlab.com:MrFry/mrfrys-node-server

This commit is contained in:
mrfry 2021-04-30 16:09:13 +02:00
commit 119660b59c
4 changed files with 24 additions and 31 deletions

View file

@ -19,7 +19,8 @@
"nextdir": "nextStatic/qminingPagePublic",
"name": "qmining",
"urls": [
"qmining.frylabs.net"
"qmining.frylabs.net",
"localhost"
],
"isNextJs": true
},
@ -30,9 +31,7 @@
],
"name": "api",
"urls": [
"api.frylabs.net",
"localhost",
"superhedghog.frylabs.net"
"api.frylabs.net"
]
},
"main": {

View file

@ -604,7 +604,11 @@ function setup(data: SubmoduleData): any {
res.json(response)
const saveableQuestions = response.reduce((acc, res) => {
if (res.answers.length === 0) {
const save = res.answers.every((answer) => {
return answer.match < 90
})
if (save) {
acc.push(res.question)
}
return acc
@ -621,6 +625,7 @@ function setup(data: SubmoduleData): any {
}
})
})
app.get('/ask', function (req: Request, res) {
if (Object.keys(req.query).length === 0) {
logger.DebugLog(`No query params /ask GET`, 'ask', 1)

View file

@ -54,15 +54,7 @@ function GetApp(): ModuleType {
auth({
userDB: userDB,
jsonResponse: false,
exceptions: [
'/thanks',
'/thanks.html',
'/img/thanks.gif',
'/favicon.ico',
'/moodle-test-userscript/stable.user.js',
'/irc',
'/donate',
],
exceptions: ['/favicon.ico', '/img/'],
})
)
app.use((req: Request, res, next) => {

View file

@ -121,7 +121,6 @@ function removePossibleAnswersDuplicates(path) {
count++
})
let removed = 0
dirs.forEach((currDir) => {
const contents = fs.readdirSync(path + '/' + currDir)
@ -163,7 +162,6 @@ function removePossibleAnswersDuplicates(path) {
utils.deleteFile(currPath2)
count--
delets++
removed++
return true
}
})
@ -171,7 +169,6 @@ function removePossibleAnswersDuplicates(path) {
})
})
})
log(`Removed ${C('red')}${removed}${C()} files total`)
log(`${C('green')}Deleting empty directories ...${C()}`)
count = dirs.length