mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 13:21:09 +10:00
Refactoring
* replace TypeORM with Kysely query builder * refactor migrations * other changes and fixes
This commit is contained in:
@ -4,38 +4,21 @@ import { AppService } from './app.service';
|
||||
import { CoreModule } from './core/core.module';
|
||||
import { EnvironmentModule } from './integrations/environment/environment.module';
|
||||
import { CollaborationModule } from './collaboration/collaboration.module';
|
||||
import { DatabaseModule } from './database/database.module';
|
||||
import { WsModule } from './ws/ws.module';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { join } from 'path';
|
||||
import { KyselyModule } from 'nestjs-kysely';
|
||||
import { EnvironmentService } from './integrations/environment/environment.service';
|
||||
import { PostgresDialect } from 'kysely';
|
||||
import { Pool } from 'pg';
|
||||
import { KyselyDbModule } from './kysely/kysely-db.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
CoreModule,
|
||||
KyselyDbModule,
|
||||
EnvironmentModule,
|
||||
DatabaseModule,
|
||||
CollaborationModule,
|
||||
WsModule,
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(__dirname, '..', '..', '..', 'client/dist'),
|
||||
}),
|
||||
KyselyModule.forRootAsync({
|
||||
imports: [],
|
||||
inject: [EnvironmentService],
|
||||
useFactory: (envService: EnvironmentService) => {
|
||||
return {
|
||||
dialect: new PostgresDialect({
|
||||
pool: new Pool({
|
||||
connectionString: envService.getDatabaseURL(),
|
||||
}) as any,
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
||||
Reference in New Issue
Block a user