From 640fe1123e733ad68339c3cf29c9413564f2da4f Mon Sep 17 00:00:00 2001 From: 5jiji Date: Wed, 10 Jul 2024 21:43:33 +0200 Subject: [PATCH] Fix all path errors (i hope) --- src/server/routes/createaccount.js | 2 +- src/server/routes/member.js | 2 +- src/server/utility/HTMLScriptInjector.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/routes/createaccount.js b/src/server/routes/createaccount.js index a1c52da41..e81564e6c 100644 --- a/src/server/routes/createaccount.js +++ b/src/server/routes/createaccount.js @@ -7,7 +7,7 @@ const createaccountController = require('../controllers/createaccountController' const {getRegisterData, checkEmailAssociated, checkUsernameAssociated} = require('../controllers/createaccountController'); router.get('/', (req, res) => { - res.sendFile(path.join(__dirname, '..', 'views', 'createaccount.html')); + res.sendFile(path.join(__dirname, '..', '..', '..', 'dist', 'views', 'createaccount.html')); }) router.post('/', createaccountController.createNewMember); diff --git a/src/server/routes/member.js b/src/server/routes/member.js index 72ec47cbe..11a3c1d2a 100644 --- a/src/server/routes/member.js +++ b/src/server/routes/member.js @@ -7,7 +7,7 @@ const {getMemberData,requestConfirmEmail} = require('../controllers/memberContro router.get('/:member', (req, res) => { - res.sendFile(path.join(__dirname, '..', 'views', 'member.html')); + res.sendFile(path.join(__dirname, '..', '..', '..', 'dist', 'views', 'member.html')); }); router.get('/:member/data', getMemberData); diff --git a/src/server/utility/HTMLScriptInjector.js b/src/server/utility/HTMLScriptInjector.js index c907fedec..35e472a20 100644 --- a/src/server/utility/HTMLScriptInjector.js +++ b/src/server/utility/HTMLScriptInjector.js @@ -92,14 +92,14 @@ function getCachedHTML(htmlFilePath) { // Inject the scripts we want... { // Inject into play.html, our OBFUSCATED htmlscript.js script. - const htmlFilePath = path.join(__dirname, '..', '..', 'client', 'views', 'play.html'); + const htmlFilePath = path.join(__dirname, '..', '..', '..', 'dist', 'views', 'play.html'); const jsFilePath = path.join(__dirname, '..', '..', '..', 'dist', 'scripts', 'game', 'htmlscript.js'); prepareAndCacheHTML(htmlFilePath, jsFilePath, ''); } { // Inject into dev.html, our htmlscript.js script. - const htmlFilePath = path.join(__dirname, '..', '..', 'client', 'views', 'dev.html'); - const jsFilePath = path.join(__dirname, '..', '..', 'client', 'scripts', 'game', 'htmlscript.js'); + const htmlFilePath = path.join(__dirname, '..', '..', '..', 'dist', 'views', 'dev.html'); + const jsFilePath = path.join(__dirname, '..', '..', '..', 'dist', 'scripts', 'game', 'htmlscript.js'); prepareAndCacheHTML(htmlFilePath, jsFilePath, ''); }