summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js7
1 files changed, 4 insertions, 3 deletions
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");