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:
parent
98b12f523e
commit
bf4bdfb249
3 changed files with 7 additions and 6 deletions
|
@ -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',
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d798a8322d33cdaf0b38771f78a5fb7b7207eefc
|
Subproject commit 5a1bd258bcdeba3f268c802fe1a81632ce57f035
|
Loading…
Add table
Add a link
Reference in a new issue