X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=routes%2Fall.js;h=79f7c3d89905dc65729f9751f1ecbd1b1c2967ff;hb=e081ffe361b06ca74db0a36bf72dd73602abf57b;hp=49ca802fa5b2f5e2663ee073f3d02f858064be52;hpb=a5d5668613d9a3d04c9a4f8b69122d02b7322137;p=vchess.git diff --git a/routes/all.js b/routes/all.js index 49ca802f..79f7c3d8 100644 --- a/routes/all.js +++ b/routes/all.js @@ -2,11 +2,12 @@ let express = require('express'); let router = express.Router(); const createError = require('http-errors'); const sqlite3 = require('sqlite3');//.verbose(); -const db = new sqlite3.Database('db/vchess.sqlite'); +const DbPath = __dirname.replace("/routes", "/db/vchess.sqlite"); +const db = new sqlite3.Database(DbPath); const sanitizeHtml = require('sanitize-html'); -const MaxNbProblems = 2; +const MaxNbProblems = 20; -const supportedLang = ["fr","en"]; +const supportedLang = ["en","es","fr"]; function selectLanguage(req, res) { // If preferred language already set: