diff --git a/src/app.module.ts b/src/app.module.ts index 8662803..b4f1518 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,9 +1,10 @@ import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; +import { UrlShortenerModule } from './url-shortener/url-shortener.module'; @Module({ - imports: [], + imports: [UrlShortenerModule], controllers: [AppController], providers: [AppService], }) diff --git a/src/url-shortener/url-shortener.controller.spec.ts b/src/url-shortener/url-shortener.controller.spec.ts new file mode 100644 index 0000000..ec2da4d --- /dev/null +++ b/src/url-shortener/url-shortener.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { UrlShortenerController } from './url-shortener.controller'; + +describe('UrlShortenerController', () => { + let controller: UrlShortenerController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [UrlShortenerController], + }).compile(); + + controller = module.get(UrlShortenerController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/url-shortener/url-shortener.controller.ts b/src/url-shortener/url-shortener.controller.ts new file mode 100644 index 0000000..0dc7d75 --- /dev/null +++ b/src/url-shortener/url-shortener.controller.ts @@ -0,0 +1,6 @@ +import { Controller } from '@nestjs/common'; + +@Controller('url-shortener') +export class UrlShortenerController { + +} diff --git a/src/url-shortener/url-shortener.module.ts b/src/url-shortener/url-shortener.module.ts new file mode 100644 index 0000000..7ef4c7c --- /dev/null +++ b/src/url-shortener/url-shortener.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { UrlShortenerService } from './url-shortener.service'; +import { UrlShortenerController } from './url-shortener.controller'; + +@Module({ + providers: [UrlShortenerService], + controllers: [UrlShortenerController] +}) +export class UrlShortenerModule {} diff --git a/src/url-shortener/url-shortener.service.spec.ts b/src/url-shortener/url-shortener.service.spec.ts new file mode 100644 index 0000000..773741e --- /dev/null +++ b/src/url-shortener/url-shortener.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { UrlShortenerService } from './url-shortener.service'; + +describe('UrlShortenerService', () => { + let service: UrlShortenerService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [UrlShortenerService], + }).compile(); + + service = module.get(UrlShortenerService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/url-shortener/url-shortener.service.ts b/src/url-shortener/url-shortener.service.ts new file mode 100644 index 0000000..134f743 --- /dev/null +++ b/src/url-shortener/url-shortener.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class UrlShortenerService {}