chore: migrate backend to monorepo apps and biome
This commit is contained in:
8
apps/notifications/src/main.ts
Normal file
8
apps/notifications/src/main.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { NotificationsModule } from './notifications.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(NotificationsModule);
|
||||
await app.listen(process.env.NOTIFICATIONS_PORT ?? 3003);
|
||||
}
|
||||
bootstrap();
|
||||
22
apps/notifications/src/notifications.controller.spec.ts
Normal file
22
apps/notifications/src/notifications.controller.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { NotificationsController } from './notifications.controller';
|
||||
import { NotificationsService } from './notifications.service';
|
||||
|
||||
describe('NotificationsController', () => {
|
||||
let notificationsController: NotificationsController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const app: TestingModule = await Test.createTestingModule({
|
||||
controllers: [NotificationsController],
|
||||
providers: [NotificationsService],
|
||||
}).compile();
|
||||
|
||||
notificationsController = app.get<NotificationsController>(NotificationsController);
|
||||
});
|
||||
|
||||
describe('root', () => {
|
||||
it('should return "Hello World!"', () => {
|
||||
expect(notificationsController.getHello()).toBe('Hello World!');
|
||||
});
|
||||
});
|
||||
});
|
||||
12
apps/notifications/src/notifications.controller.ts
Normal file
12
apps/notifications/src/notifications.controller.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { NotificationsService } from './notifications.service';
|
||||
|
||||
@Controller()
|
||||
export class NotificationsController {
|
||||
constructor(private readonly notificationsService: NotificationsService) {}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.notificationsService.getHello();
|
||||
}
|
||||
}
|
||||
10
apps/notifications/src/notifications.module.ts
Normal file
10
apps/notifications/src/notifications.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { NotificationsController } from './notifications.controller';
|
||||
import { NotificationsService } from './notifications.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [NotificationsController],
|
||||
providers: [NotificationsService],
|
||||
})
|
||||
export class NotificationsModule {}
|
||||
8
apps/notifications/src/notifications.service.ts
Normal file
8
apps/notifications/src/notifications.service.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class NotificationsService {
|
||||
getHello(): string {
|
||||
return 'Hello World!';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user