diff options
| author | Bobby <[email protected]> | 2022-03-15 00:17:29 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-03-15 00:17:29 -0400 |
| commit | 65a6e19d097cda17e0f748b21cf3befce09dc49f (patch) | |
| tree | 2a2137930c133f295d7da96fec1eaf5934f51a13 /server.js | |
| parent | d67ca9d8d18a70ffd1eb0743fed80c8a0e78422b (diff) | |
| download | luciferreeves.github.io-65a6e19d097cda17e0f748b21cf3befce09dc49f.tar.xz luciferreeves.github.io-65a6e19d097cda17e0f748b21cf3befce09dc49f.zip | |
admin login logout functionality
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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, () => { |
