26 lines
766 B
TypeScript
26 lines
766 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ScheduleModule } from '@nestjs/schedule';
|
|
import { AppController } from './app.controller';
|
|
import { AppService } from './app.service';
|
|
import { CacheModule } from '@nestjs/cache-manager';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { join } from 'path';
|
|
import { WeatherEntity } from './entities/weather.entity';
|
|
|
|
@Module({
|
|
imports: [
|
|
CacheModule.register(),
|
|
TypeOrmModule.forRoot({
|
|
type: 'sqlite',
|
|
database: join(process.cwd(), 'data.sqlite'),
|
|
entities: [WeatherEntity],
|
|
synchronize: true,
|
|
}),
|
|
TypeOrmModule.forFeature([WeatherEntity]),
|
|
ScheduleModule.forRoot(),
|
|
],
|
|
controllers: [AppController],
|
|
providers: [AppService],
|
|
})
|
|
export class AppModule {}
|