require("dotenv").config();

if (!process.env.MONGODB_URI) {
  console.error("❌ ERROR: MONGODB_URI is not defined in .env file");
  process.exit(1);
}

const config = {
  mongodbUri: process.env.MONGODB_URI,
  port: process.env.PORT || 3000,
  isProduction: process.env.NODE_ENV === "production",
  gameServerSecret: process.env.GAME_SERVER_SECRET || "secret",
};

module.exports = config;
