Compare commits
No commits in common. "1a331963d61a8c95c50bdd56d8be4f79708480d3" and "9bb442efe3206698a16d4cdf168040e8371cdd15" have entirely different histories.
1a331963d6
...
9bb442efe3
@ -25,9 +25,9 @@ jobs:
|
|||||||
- name: Clean install
|
- name: Clean install
|
||||||
run: npm ci
|
run: npm ci
|
||||||
working-directory: ./${{ matrix.workingdir }}
|
working-directory: ./${{ matrix.workingdir }}
|
||||||
# - name: Run lint
|
- name: Run lint
|
||||||
# run: npm run lint
|
run: npm run lint
|
||||||
# working-directory: ./${{ matrix.workingdir }}
|
working-directory: ./${{ matrix.workingdir }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
working-directory: ./${{ matrix.workingdir }}
|
working-directory: ./${{ matrix.workingdir }}
|
||||||
|
@ -3,15 +3,11 @@ import { AppController } from './app.controller';
|
|||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { PostsModule } from './posts/posts.module';
|
import { PostsModule } from './posts/posts.module';
|
||||||
import { DatabaseModule } from './database/database.module';
|
import { DatabaseModule } from './database/database.module';
|
||||||
import configuration from './config/configuration';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
ConfigModule.forRoot({
|
|
||||||
load: [configuration],
|
|
||||||
}),
|
|
||||||
DatabaseModule,
|
|
||||||
PostsModule,
|
PostsModule,
|
||||||
|
DatabaseModule
|
||||||
],
|
],
|
||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
providers: [AppService],
|
providers: [AppService],
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
export default () => ({
|
|
||||||
port: parseInt(process.env.BLOG_PORT, 10) || 3000,
|
|
||||||
database: {
|
|
||||||
host: process.env.POSTGRES_HOST,
|
|
||||||
port: parseInt(process.env.POSTGRES_PORT, 10) || 5432,
|
|
||||||
name: process.env.BLOG_DB_NAME,
|
|
||||||
user: process.env.BLOG_DB_USER,
|
|
||||||
password: process.env.BLOG_DB_PASSWORD,
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,22 +1,19 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||||
import configuration from './config/configuration';
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
ConfigModule.forRoot({
|
ConfigModule.forRoot(),
|
||||||
load: [configuration]
|
|
||||||
}),
|
|
||||||
TypeOrmModule.forRootAsync({
|
TypeOrmModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
imports: [ConfigModule],
|
||||||
useFactory: (configService: ConfigService) => ({
|
useFactory: (configService: ConfigService) => ({
|
||||||
type: 'postgres',
|
type: 'postgres',
|
||||||
host: configService.get('database.host'),
|
host: configService.get('POSTGRES_HOST'),
|
||||||
port: configService.get('database.port'),
|
port: configService.get('POSTGRES_PORT'),
|
||||||
username: configService.get('database.user'),
|
username: configService.get('BLOG_DB_USER'),
|
||||||
password: configService.get('database.password'),
|
password: configService.get('BLOG_DB_PASSWORD'),
|
||||||
database: configService.get('database.name'),
|
database: configService.get('BLOG_DB_NAME'),
|
||||||
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
|
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
|
||||||
synchronize: true, // Be cautious about using synchronize in production
|
synchronize: true, // Be cautious about using synchronize in production
|
||||||
}),
|
}),
|
||||||
|
@ -6,5 +6,4 @@ async function bootstrap() {
|
|||||||
app.enableCors();
|
app.enableCors();
|
||||||
await app.listen(process.env.PORT ?? 3000);
|
await app.listen(process.env.PORT ?? 3000);
|
||||||
}
|
}
|
||||||
|
bootstrap();
|
||||||
await bootstrap();
|
|
||||||
|
@ -4,6 +4,6 @@ import { PostsService } from './posts.service';
|
|||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
controllers: [PostsController],
|
controllers: [PostsController],
|
||||||
providers: [PostsService],
|
providers: [PostsService]
|
||||||
})
|
})
|
||||||
export class PostsModule {}
|
export class PostsModule {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user