Настройка главного приложения nest для использования react в качестве фронтенда

This commit is contained in:
Pavel Gnedov 2023-03-10 18:50:14 +07:00
parent 6e4e32f6cb
commit 9fb35332d2
2 changed files with 7 additions and 10 deletions

View file

@ -1,12 +1,4 @@
import { Controller, Get } from '@nestjs/common'; import { Controller } from '@nestjs/common';
import { AppService } from './app.service';
@Controller() @Controller()
export class AppController { export class AppController {}
constructor(private readonly appService: AppService) {}
@Get()
getHello(): string {
return this.appService.getHello();
}
}

View file

@ -45,6 +45,8 @@ import { SimpleKanbanBoardController } from './dashboards/simple-kanban-board.co
import { IssueUrlEnhancer } from '@app/event-emitter/issue-enhancers/issue-url-enhancer'; import { IssueUrlEnhancer } from '@app/event-emitter/issue-enhancers/issue-url-enhancer';
import { IssuesByTagsWidgetService } from './dashboards/widgets/issues-by-tags.widget.service'; import { IssuesByTagsWidgetService } from './dashboards/widgets/issues-by-tags.widget.service';
import { CategoryMergeToTagsEnhancer } from './issue-enhancers/category-merge-to-tags-enhancer'; import { CategoryMergeToTagsEnhancer } from './issue-enhancers/category-merge-to-tags-enhancer';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
@Module({ @Module({
imports: [ imports: [
@ -56,6 +58,9 @@ import { CategoryMergeToTagsEnhancer } from './issue-enhancers/category-merge-to
isGlobal: true, isGlobal: true,
}), }),
ScheduleModule.forRoot(), ScheduleModule.forRoot(),
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'frontend', 'build'),
}),
], ],
controllers: [ controllers: [
AppController, AppController,