Closed lopezm94 closed 6 years ago
I'm experiencing the same thing. @lopezm94 what did you change this to to fix it?
It feels to me that like the ormconfig.json
should be eliminated. Right now there's duped information between that and the env
file.
Currently we only need the ormconfig.json
because of the TypeORM CLI.
It feels to me that like the ormconfig.json should be eliminated. Right now there's duped information between that and the env file.
The single truth is env.ts
, which uses .env
and is used for ormconfig.json
generation.
@lopezm94 & @et: Would I make sense if the ormconfig.json
is copyed to dist
after a build?
@dweber019 - copying the ormconfig.json
would work.
If that workflow seems complicated though, typeorm can just pluck environment variables from the .env
file: https://github.com/typeorm/typeorm/blob/master/docs/using-ormconfig.md#using-environment-variables
@et you're right. Setting the environment variables is the proper way. Will close this issue.
What we do is deploy the whole project (not only the dist) and therefore it works.
@dweber019 - what would help though for people though is to provide uniformity with the db env variables.
So in the .env file, they should be renamed to TYPEORM_
variables.
@et could you have a look at https://github.com/w3tecch/express-typescript-boilerplate/pull/95 and provide some feedback what you think. Thanks
I have run with an issue recently when pushing code to production.
commands/ormconfig.ts
hassrc/env
hardcoded instead ofsrc/dist
. This presents a "problem" when doing migrations with the built code, would you mind if I add a new command inpackage.json
?P.S Awesome work in the package!