mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 01:49:40 +02:00
NestJS-based web crawler service for structured content extraction. Features: - Depth-controlled crawling with URL pattern filtering - robots.txt compliance - HTML/PDF/Markdown content extraction - BullMQ job queue for async processing - Redis caching layer - Prometheus metrics
24 lines
611 B
TypeScript
24 lines
611 B
TypeScript
import { Global, Module } from '@nestjs/common';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { getDb } from './connection';
|
|
|
|
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';
|
|
|
|
@Global()
|
|
@Module({
|
|
providers: [
|
|
{
|
|
provide: DATABASE_CONNECTION,
|
|
useFactory: (configService: ConfigService) => {
|
|
const databaseUrl = configService.get<string>('database.url');
|
|
if (!databaseUrl) {
|
|
throw new Error('DATABASE_URL is not configured');
|
|
}
|
|
return getDb(databaseUrl);
|
|
},
|
|
inject: [ConfigService],
|
|
},
|
|
],
|
|
exports: [DATABASE_CONNECTION],
|
|
})
|
|
export class DatabaseModule {}
|