diff --git a/API/.env.example b/API/.env.example new file mode 100644 index 0000000..cd30a87 --- /dev/null +++ b/API/.env.example @@ -0,0 +1,21 @@ +# Galaxy Strike Online - API Server Environment +# Copy to .env and fill in values + +# Server +PORT=3001 +NODE_ENV=development + +# Database +MONGODB_URI=mongodb://localhost:27017/galaxystrikeonline + +# Auth +JWT_SECRET=your-super-secret-jwt-key-change-in-production + +# Game Server URL (for server browser) +GAME_SERVER_URL=http://localhost:3002 + +# Client URL (for CORS) +CLIENT_URL=http://localhost:3000 + +# Logging +LOG_LEVEL=info diff --git a/API/server.js b/API/server.js index 2eacb55..5d00c77 100644 --- a/API/server.js +++ b/API/server.js @@ -37,8 +37,22 @@ const server = http.createServer(app); // Middleware app.use(helmet()); app.use(compression()); +const allowedOrigins = [ + "https://galaxystrike.online", + "https://api.korvarix.com", + "http://api.korvarix.com:3001", + "https://dev.gameserver.galaxystrike.online", + "http://localhost:3000", + "http://localhost:3001", + "http://localhost:3002", + ...(process.env.CLIENT_URL ? [process.env.CLIENT_URL] : []), +]; app.use(cors({ - origin: ["https://galaxystrike.online", "https://api.korvarix.com", "http://api.korvarix.com:3001", "https://dev.gameserver.galaxystrike.online"], + origin: (origin, callback) => { + // Allow no-origin (Electron, mobile, curl) + whitelisted origins + if (!origin || allowedOrigins.includes(origin)) return callback(null, true); + return callback(null, false); + }, credentials: true })); app.use(express.json({ limit: '10mb' })); diff --git a/Client/index.html b/Client/index.html index 3963f18..8a5d698 100644 --- a/Client/index.html +++ b/Client/index.html @@ -228,18 +228,34 @@
-
-
- +
+
+ 1,000
-
- +
+ 10
-
- - 100/100 + + + + +
@@ -312,12 +328,125 @@ Ranks + + + + - + + + + + + + + + + + +
+ + + + + +

Fleet Status

@@ -350,7 +479,13 @@
Experience - 0 / 100 + 0 / 500 +
+ +
+
+
+
Skill Points @@ -426,10 +561,10 @@
- - - - + + + +
@@ -460,58 +595,77 @@
- +