mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 08:20:50 +00:00
Gate Vite dev server LAN binding behind VITE_HOST=lan
`npm run dev` now binds to 127.0.0.1 by default; use `npm run dev:host` to expose the dev server on the local network for phone/device testing.
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
"start:server": "tsx src/server/Server.ts",
|
"start:server": "tsx src/server/Server.ts",
|
||||||
"start:server-dev": "cross-env GAME_ENV=dev NUM_WORKERS=2 TURNSTILE_SITE_KEY=1x00000000000000000000AA API_KEY=WARNING_DEV_API_KEY_DO_NOT_USE_IN_PRODUCTION DOMAIN=localhost GIT_COMMIT=DEV tsx src/server/Server.ts",
|
"start:server-dev": "cross-env GAME_ENV=dev NUM_WORKERS=2 TURNSTILE_SITE_KEY=1x00000000000000000000AA API_KEY=WARNING_DEV_API_KEY_DO_NOT_USE_IN_PRODUCTION DOMAIN=localhost GIT_COMMIT=DEV tsx src/server/Server.ts",
|
||||||
"dev": "cross-env GAME_ENV=dev concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
"dev": "cross-env GAME_ENV=dev concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
||||||
|
"dev:host": "cross-env GAME_ENV=dev VITE_HOST=lan concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
||||||
"dev:staging": "cross-env GAME_ENV=dev API_DOMAIN=api.openfront.dev concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
"dev:staging": "cross-env GAME_ENV=dev API_DOMAIN=api.openfront.dev concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
||||||
"dev:prod": "cross-env GAME_ENV=dev API_DOMAIN=api.openfront.io concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
"dev:prod": "cross-env GAME_ENV=dev API_DOMAIN=api.openfront.io concurrently \"npm run start:client\" \"npm run start:server-dev\"",
|
||||||
"docs:map-generator": "cd map-generator && go doc -cmd -u -all",
|
"docs:map-generator": "cd map-generator && go doc -cmd -u -all",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
|
|
||||||
server: {
|
server: {
|
||||||
port: 9000,
|
port: 9000,
|
||||||
|
host: process.env.VITE_HOST === "lan",
|
||||||
// Automatically open the browser when the server starts
|
// Automatically open the browser when the server starts
|
||||||
open: process.env.SKIP_BROWSER_OPEN !== "true",
|
open: process.env.SKIP_BROWSER_OPEN !== "true",
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|||||||
Reference in New Issue
Block a user