diff --git a/src/app.module.ts b/src/app.module.ts index 8662803..563c676 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,10 +1,11 @@ import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; +import { PostsController } from './posts/posts.controller'; @Module({ imports: [], - controllers: [AppController], + controllers: [AppController, PostsController], providers: [AppService], }) export class AppModule {} diff --git a/src/posts/posts.controller.spec.ts b/src/posts/posts.controller.spec.ts new file mode 100644 index 0000000..6ab5648 --- /dev/null +++ b/src/posts/posts.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { PostsController } from './posts.controller'; + +describe('Posts Controller', () => { + let controller: PostsController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [PostsController], + }).compile(); + + controller = module.get(PostsController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/posts/posts.controller.ts b/src/posts/posts.controller.ts new file mode 100644 index 0000000..572624f --- /dev/null +++ b/src/posts/posts.controller.ts @@ -0,0 +1,4 @@ +import { Controller } from '@nestjs/common'; + +@Controller('posts') +export class PostsController {}