From 7ff1d8299574dd142ea38091e28ad5c2941b2427 Mon Sep 17 00:00:00 2001 From: Rafael Marçalo Date: Sun, 23 Oct 2022 02:25:00 +0100 Subject: Fixed up paths for electron --- app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index d5e08a6..04ea216 100644 --- a/app.js +++ b/app.js @@ -1,18 +1,19 @@ "use strict"; // handling imports -const express = require('express'); const bodyParser = require('body-parser'); +const express = require('express'); +const path = require('path'); const app = express(); const PORT = module.exports.PORT = process.env.PORT || 3000; - // set the public folder to public acess and added a body parser -app.use(express.static('public')); +app.use(express.static(path.join(__dirname, '/public'))); app.use(bodyParser.urlencoded({extended: true})); // set the view engine to ejs app.set('view engine', 'ejs'); +app.set('views', path.join(__dirname, '/views')); // routes management const home = require("./routes/home"); -- cgit v1.2.3