mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
feat: Use real database config for app
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
cd5256da7f
commit
b670702f41
1 changed files with 16 additions and 6 deletions
|
@ -17,7 +17,7 @@ import appConfig from './config/app.config';
|
||||||
import authConfig from './config/auth.config';
|
import authConfig from './config/auth.config';
|
||||||
import cspConfig from './config/csp.config';
|
import cspConfig from './config/csp.config';
|
||||||
import customizationConfig from './config/customization.config';
|
import customizationConfig from './config/customization.config';
|
||||||
import databaseConfig from './config/database.config';
|
import databaseConfig, { DatabaseConfig } from './config/database.config';
|
||||||
import externalConfig from './config/external-services.config';
|
import externalConfig from './config/external-services.config';
|
||||||
import hstsConfig from './config/hsts.config';
|
import hstsConfig from './config/hsts.config';
|
||||||
import mediaConfig from './config/media.config';
|
import mediaConfig from './config/media.config';
|
||||||
|
@ -49,11 +49,21 @@ const routes: Routes = [
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoutes(routes),
|
RouterModule.forRoutes(routes),
|
||||||
TypeOrmModule.forRoot({
|
TypeOrmModule.forRootAsync({
|
||||||
type: 'sqlite',
|
imports: [ConfigModule],
|
||||||
database: './hedgedoc.sqlite',
|
inject: [databaseConfig.KEY],
|
||||||
|
useFactory: (databaseConfig: DatabaseConfig) => {
|
||||||
|
return {
|
||||||
|
type: databaseConfig.type,
|
||||||
|
host: databaseConfig.host,
|
||||||
|
port: databaseConfig.port,
|
||||||
|
username: databaseConfig.username,
|
||||||
|
password: databaseConfig.password,
|
||||||
|
database: databaseConfig.database,
|
||||||
autoLoadEntities: true,
|
autoLoadEntities: true,
|
||||||
synchronize: true, // ToDo: Remove this before release
|
synchronize: true, // ToDo: Remove this before release
|
||||||
|
};
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
ConfigModule.forRoot({
|
ConfigModule.forRoot({
|
||||||
load: [
|
load: [
|
||||||
|
|
Loading…
Reference in a new issue