feat: add docker compose, use @fennec/configuration.
This commit is contained in:
@ -26,7 +26,7 @@ import { TagsModule } from './tags/tags.module';
|
||||
username: configService.get<string>('db.postgres.username'),
|
||||
password: configService.get<string>('db.postgres.password'),
|
||||
database: configService.get<string>('db.postgres.database'),
|
||||
synchronize: true,
|
||||
synchronize: false,
|
||||
autoLoadEntities: true,
|
||||
}),
|
||||
inject: [ConfigService],
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { ServiceRegister } from '@fennec/configuration';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
@ -15,9 +16,11 @@ async function bootstrap() {
|
||||
}),
|
||||
);
|
||||
app.useGlobalFilters(new HttpExceptionFilter());
|
||||
await app.listen(configService.get<number>('http.port'));
|
||||
const server = await app.listen(configService.get<number>('http.port', 0));
|
||||
const port = server.address().port;
|
||||
const register = new ServiceRegister({ etcd: { hosts: 'http://rpi:2379' } });
|
||||
register.register('fennec/api', `http://localhost:${port}`);
|
||||
register.register('api.fennec', `http://localhost:${port}`);
|
||||
register.register('blog/api', `http://localhost:${port}`);
|
||||
register.register('admin.blog/api', `http://localhost:${port}`);
|
||||
register.register('api.blog', `http://localhost:${port}`);
|
||||
}
|
||||
bootstrap();
|
||||
|
Reference in New Issue
Block a user