aboutsummaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-03-15 00:17:29 -0400
committerBobby <[email protected]>2022-03-15 00:17:29 -0400
commit65a6e19d097cda17e0f748b21cf3befce09dc49f (patch)
tree2a2137930c133f295d7da96fec1eaf5934f51a13 /server.js
parentd67ca9d8d18a70ffd1eb0743fed80c8a0e78422b (diff)
downloadluciferreeves.github.io-65a6e19d097cda17e0f748b21cf3befce09dc49f.tar.xz
luciferreeves.github.io-65a6e19d097cda17e0f748b21cf3befce09dc49f.zip
admin login logout functionality
Diffstat (limited to 'server.js')
-rw-r--r--server.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/server.js b/server.js
index dfcf98d..cb0896f 100644
--- a/server.js
+++ b/server.js
@@ -1,6 +1,7 @@
// Import Express and CORS
const express = require("express");
const cors = require("cors");
+const bodyParser = require("body-parser");
// Import the routes
const routes = require("./routes");
@@ -10,16 +11,19 @@ const app = express();
// Set the port
const port = process.env.PORT || 3000;
-
// Set the middleware
-app.use(cors());
-app.use(express.json());
-app.use(express.urlencoded({ extended: true }));
-app.use(express.static(__dirname + "/public"));
+app.use(cors({ origin: true }));
+app.use(bodyParser.json());
+app.use(bodyParser.urlencoded({
+ extended: true
+}));
app.use("/static", express.static(__dirname + "/static"));
+app.use(express.static(__dirname + '/public'));
app.use(routes);
-// Set public folder
+app.set('views', __dirname + '/public/views');
+app.engine('html', require('ejs').renderFile);
+app.set('view engine', 'html');
// Start the server
app.listen(port, () => {