Comments (6)
Remember that, according the answer, it will be a prod db connection with sqlite (or mongodb)..
``
const defaultOptions = {
type: 'postgres',
port: 5432,
username: 'user',
password: 'password',
database: 'db',
synchronize: true,
};
@module({
imports: [
TypeOrmModule.forRoot({
...defaultOptions,
host: 'photo_db_host',
entities: [Photo],
})
``
So, according the environment (dev or prod), the connection must be changed. Please attention that in dev mode there is always the sqlite db.
from generator-jhipster-nodejs.
The issue is not more an optional, because we have to provide a migration with typeORM for scripts in dev mode running for sqlite
from generator-jhipster-nodejs.
Consider feature/migration-db and this src/ormconfig.ts:
import { ConnectionOptions } from 'typeorm'; const config: ConnectionOptions = { type: 'postgres', host: process.env.POSTGRES_HOST, port: Number(process.env.POSTGRES_PORT), username: process.env.POSTGRES_USER, password: process.env.POSTGRES_PASSWORD, database: process.env.POSTGRES_DB, entities: [ __dirname + '/../**/*.entity{.ts,.js}', ], cli: { migrationsDir: 'src/migrations', }}; export = config;
from generator-jhipster-nodejs.
from generator-jhipster-nodejs.
Hi @deepu105,
now for this blueprint, in the server generator there are only two questions: serverPort and mongoProdDatabase . The other prompts questions for the server generation are been delated, because in this blueprint they haven't sense to be due to their java spring meaning. So if you answer to yes for the mongoProdDatabase there will generated the config for this, otherwise the sqlite is the default. So be sure that there aren't other database questions. For this I have renamed the issue. If it is not clear, feel free to ask me.
from generator-jhipster-nodejs.
from generator-jhipster-nodejs.
Related Issues (20)
- Impossible to upgrade JHipster, Impossible to run it HOT 3
- Running jhipster-generator-nodejs via Docker give error HOT 2
- Mongodb relationship: I get an error that mongodb relationships are not supported. HOT 1
- JWT Token Should bo Compatible with Jhipster (Java Version) HOT 1
- Application hangs when hasAnyAuthority function is used multiple times on same page with different role :- VueJS HOT 2
- JHipster Registry doesn't recognize microservices or gateway HOT 6
- Error: "prettier/@typescript-eslint" has been merged into "prettier" in eslint-config-prettier 8.0.0 HOT 6
- Unable to start njhipster docker generated application code - src/client/header-util.ts(54,15): error TS2552: Cannot find name 'URL'. Did you mean 'url'? HOT 4
- sort.split is not a function or its return value is not iterable HOT 4
- nice
- Generated React Js code isn't working. HOT 1
- Update to latest node (lts) and package versions. HOT 5
- Filter for endpoints HOT 3
- takes too much time to run the code after any change HOT 3
- This needs support for macOS Ventura HOT 2
- Issues with NHipster Generator: Backend module import and frontend library compatibility HOT 1
- Migrate to JHipster v8 HOT 4
- Update NestJS packages. HOT 2
- jdl import
- Nodejs library upgrade HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-jhipster-nodejs.