mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Data loading changes
This commit is contained in:
@@ -94,7 +94,6 @@ function GetApp(): ModuleType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// files in public dirs
|
// files in public dirs
|
||||||
const questionDbsDir = publicDir + 'questionDbs'
|
|
||||||
const dbsFile = publicDir + 'questionDbs.json'
|
const dbsFile = publicDir + 'questionDbs.json'
|
||||||
const savedQuestionsDir = publicDir + 'savedQuestions'
|
const savedQuestionsDir = publicDir + 'savedQuestions'
|
||||||
const recivedFiles = publicDir + 'recivedfiles'
|
const recivedFiles = publicDir + 'recivedfiles'
|
||||||
@@ -147,7 +146,7 @@ function GetApp(): ModuleType {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
const questionDbs = loadJSON(dataFiles, questionDbsDir)
|
const questionDbs = loadJSON(dataFiles, publicDir)
|
||||||
let version = ''
|
let version = ''
|
||||||
let rootRedirectURL = ''
|
let rootRedirectURL = ''
|
||||||
let motd = ''
|
let motd = ''
|
||||||
@@ -289,7 +288,7 @@ function GetApp(): ModuleType {
|
|||||||
res.json(
|
res.json(
|
||||||
dataFiles.map((df) => {
|
dataFiles.map((df) => {
|
||||||
return {
|
return {
|
||||||
path: df.path.split('/').pop(),
|
path: df.path,
|
||||||
name: df.name,
|
name: df.name,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1051,7 +1050,6 @@ function GetApp(): ModuleType {
|
|||||||
|
|
||||||
function saveQuestion(questions, subj, location, userid) {
|
function saveQuestion(questions, subj, location, userid) {
|
||||||
// TODO: clear folder every now and then, check if saved questions exist
|
// TODO: clear folder every now and then, check if saved questions exist
|
||||||
// TODO: group questions by suject
|
|
||||||
const questionsToSave = {
|
const questionsToSave = {
|
||||||
questions: questions,
|
questions: questions,
|
||||||
subj: subj,
|
subj: subj,
|
||||||
|
@@ -143,10 +143,13 @@ function GetApp(): ModuleType {
|
|||||||
to: '/',
|
to: '/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// to be backwards compatible
|
|
||||||
from: '/legacy',
|
from: '/legacy',
|
||||||
to: '/allQuestions.html',
|
to: '/allQuestions.html',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
from: '/subjectBrowser',
|
||||||
|
to: '/allQuestions.html',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
from: '/lred',
|
from: '/lred',
|
||||||
to: '/allQuestions',
|
to: '/allQuestions',
|
||||||
|
Submodule submodules/qmining-page updated: d798a8322d...5a1bd258bc
Reference in New Issue
Block a user