-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ⚡️ Add a proper front page, error messages and a domain check
- Loading branch information
Showing
5 changed files
with
891 additions
and
1,933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`)); |
Oops, something went wrong.