Advance on Spanish translation (still 13 rules to translate)
[vchess.git] / routes / all.js
index 5ab6ae9..79f7c3d 100644 (file)
@@ -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 = 20;
 
-const supportedLang = ["fr","en"];
+const supportedLang = ["en","es","fr"];
 function selectLanguage(req, res)
 {
        // If preferred language already set: