PaimaStudios / paima-game-templates

Paima Engine Game Templates for developers.
https://paimastudios.com
MIT License
11 stars 8 forks source link

change-db.js improvements #76

Closed GGAlanSmithee closed 4 months ago

GGAlanSmithee commented 4 months ago

There are two potential improvements with the chage-db.js script that comes with the templates

The script uses process.env.NETWORK ?? 'localhost' but since env variables are never injected into the file (with dotenv for example) this will only ever work with localhost, which should be fine for most cases, but not all of them (if using a proxy for example).

I suggest that we simply inject the env variables from ../.env.localhost (or ../.env.{environment} if it's expected to work in a non-development setting).

ie:

const { config } = require('dotenv');
config('../.env.localhost');
GGAlanSmithee commented 4 months ago

ah, nvm, a misunderstanding on my part :bow: closing