Last active
December 8, 2019 20:04
-
-
Save karfau/b6d0927628f6662ca6d892153562522f to your computer and use it in GitHub Desktop.
workaround for typeorm no longer loading ormconfig.env by default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://gist.github.com/karfau/b6d0927628f6662ca6d892153562522f | |
// 1. copy this file to your root directory alongside ormconfig.env | |
// in your package.json scripts/mocha.opts, etc add | |
// --reqister ./ormconfig.register.js | |
// or | |
// -r ./ormconfig.register.js | |
const {config} = require('dotenv'); | |
const path = require('path'); | |
config({path: path.join(__dirname, 'ormconfig.env')}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment