Created
June 11, 2020 21:43
-
-
Save danileao/899cba571261e634ae8a82863091e32f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
TYPEORM_MIGRATION = ./src/database/migrations/*.ts | |
TYPEORM_ENTITIES = ./src/models/*.ts | |
TYPEORM_MIGRATION_DIR = ./src/database/migrations |
This file contains hidden or 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
TYPEORM_MIGRATION = ./dist/database/migrations/*.js | |
TYPEORM_ENTITIES = ./dist/models/*.js | |
TYPEORM_MIGRATION_DIR = ./dist/database/migrations |
This file contains hidden or 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
const dotevnt = require("dotenv"); | |
dotevnt.config({ | |
path: process.env.NODE_ENV === "dev" ? ".env.dev" : ".env.production", | |
}); | |
module.exports = { | |
type: "postgres", | |
host: "localhost", | |
port: 5432, | |
username: "", | |
password: "", | |
database: "", | |
migrations: [process.env.TYPEORM_MIGRATION], | |
entities: [process.env.TYPEORM_ENTITIES], | |
cli: { | |
migrationsDir: process.env.TYPEORM_MIGRATION_DIR, | |
}, | |
}; |
This file contains hidden or 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
"scripts": { | |
"build": "NODE_ENV=production tsc --target ES5 --experimentalDecorators --emitDecoratorMetadata", | |
"dev:server": "NODE_ENV=dev ts-node-dev --transpileOnly --ignore-watch node_modules src/server.ts" | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment