pagefaultgames / pokerogue

A browser based Pokémon fangame heavily inspired by the roguelite genre.
https://pokerogue.net
GNU Affero General Public License v3.0
4.54k stars 1.82k forks source link

Request: Selfhost options #541

Closed Jafarista closed 5 months ago

Jafarista commented 6 months ago

Could you add the options to change hosted port and also whether it's localhost only, instead of across all network interfaces?

Thanks.

CodeTappert commented 6 months ago

Until it is implemented by the devs.

Here is a solution you can change at your local files for urself.

Go to package.json and add a new entry to "scripts"

For example

"local": "vite --host 127.0.0.1 --port 3000",

Then your application will only run on 127.0.0.1 and port 3000.

If you change host to 0.0.0.0 or omit it completly it will run on all network interfaces

Here is my package.json after only adding this one line:


{
    "name": "pokemon-rogue-battle",
    "private": true,
    "version": "1.0.4",
    "type": "module",
    "scripts": {
        "local": "vite --host 127.0.0.1 --port 3000",
        "start": "vite",
        "start:dev": "vite --mode development",
        "build": "vite build",
        "preview": "vite preview",
        "test": "vitest run",
        "test:cov": "vitest run --coverage",
        "test:watch": "vitest watch --coverage"
    },
    "devDependencies": {
        "@vitest/coverage-istanbul": "^1.4.0",
        "axios": "^1.6.2",
        "axios-cache-interceptor": "^1.3.2",
        "eslint": "^8.25.0",
        "jsdom": "^24.0.0",
        "json-beautify": "^1.1.1",
        "phaser3spectorjs": "^0.0.8",
        "pokenode-ts": "^1.20.0",
        "typescript": "^5.0.3",
        "vite": "^4.5.0",
        "vite-plugin-fs": "^0.4.4",
        "vitest": "^1.4.0",
        "vitest-canvas-mock": "^0.3.3"
    },
    "dependencies": {
        "@material/material-color-utilities": "^0.2.7",
        "crypto-js": "^4.2.0",
        "i18next": "^23.11.1",
        "i18next-browser-languagedetector": "^7.2.1",
        "json-stable-stringify": "^1.1.0",
        "phaser": "^3.70.0",
        "phaser3-rex-plugins": "^1.1.84"
    },
    "engines": {
        "node": ">=18.0.0"
    },
    "imports": {
        "#app": "./src/main.js",
        "#app/*": "./src/*"
    }
}
CodeTappert commented 5 months ago

You can now change the port and ip of the server in the .env file.

For all other things see my comment above