From: Benjamin Auder Date: Thu, 19 Mar 2020 23:14:08 +0000 (+0100) Subject: Fix typo in server/README + increase interoperability following https://github.com... X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/current/%7B%7B%20path%28%27mixstore_static_about%27%29%20%7D%7D?a=commitdiff_plain;h=1ad8802192781dde074aa4b9529bd65c405ccc6f;p=vchess.git Fix typo in server/README + increase interoperability following https://github.com/yagu0/vchess/pull/13 --- diff --git a/server/README.md b/server/README.md index d896b014..ebcaf771 100644 --- a/server/README.md +++ b/server/README.md @@ -13,7 +13,7 @@ Instructions to run the server locally. ``` cd server/db -sqlite3 vchess.sqlite.db +sqlite3 vchess.sqlite sqlite> .read create.sql sqlite> .read populate.sql sqlite> .exit diff --git a/server/routes/messages.js b/server/routes/messages.js index 9355ff92..441abdb3 100644 --- a/server/routes/messages.js +++ b/server/routes/messages.js @@ -1,7 +1,7 @@ let router = require("express").Router(); const access = require("../utils/access"); -const sendEmail = require(__dirname.replace("/routes", "/utils/mailer")); -const params = require(__dirname.replace("/routes", "/config/parameters")); +const sendEmail = require("../utils/mailer"); +const params = require("../config/parameters"); // Send a message through contact form router.post("/messages", access.ajax, (req,res) => { diff --git a/server/utils/database.js b/server/utils/database.js index 7c20d521..b808257c 100644 --- a/server/utils/database.js +++ b/server/utils/database.js @@ -1,9 +1,12 @@ const sqlite3 = require('sqlite3'); +const path = require('path'); const params = require("../config/parameters") if (params.env == "development") sqlite3.verbose(); -const DbPath = __dirname.replace("/utils", "/db/vchess.sqlite"); +const DbPath = __dirname.replace( + `${path.sep}utils`, + `${path.sep}db${path.sep}vchess.sqlite`); const db = new sqlite3.Database(DbPath); module.exports = db;