Skip to content

Commit

Permalink
feat: ⚡️ Add a proper front page, error messages and a domain check
Browse files Browse the repository at this point in the history
  • Loading branch information
knice committed Jan 22, 2024
1 parent 986a451 commit 830317b
Show file tree
Hide file tree
Showing 5 changed files with 891 additions and 1,933 deletions.
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
const compression = require("compression");
const express = require("express");
const flash = require('express-flash');
const session = require('express-session');
const app = express();
const port = process.env.PORT || 5500;

// Session setup
app.use(session({
secret: process.env.SESSION_SECRET, // Replace with a real secret in production
resave: false,
saveUninitialized: true,
cookie: { secure: process.env.SECURE_COOKIE || true } // Set to true if using https
}));

app.use(compression());
app.use(flash());
app.use(express.json({ extended: false }));
app.use("/", require("./routes/index"));

app.set('view engine', 'ejs');

app.listen(port, () => console.log(`Server is running on port ${port}`));
Loading

0 comments on commit 830317b

Please sign in to comment.