require('dotenv').config();
const express = require('express');
const path = require('path');

const app = express();
const port = 3001;
const session = require('express-session');

app.use(session({
  resave: false,
  saveUninitialized: false,
  cookie: { 
    secure: process.env.SECURE === 'true',
  }
}));

app.use(express.json());

app.listen(port, () => {
  console.log(`Server running on http://localhost:${port}`);
});

module.exports = app;
