Browse Source

staged chagne

enzo 1 week ago
parent
commit
b1377da92a

+ 0 - 3
.gitignore

@@ -3,9 +3,6 @@
 /node_modules
 /build
 
-apps/fis-fingerprint
-apps/fis-verification
-
 # Logs
 logs
 *.log

+ 0 - 0
.gitmodules


+ 22 - 0
apps/fis-fingerprint/src/fis-fingerprint.controller.spec.ts

@@ -0,0 +1,22 @@
+import { Test, TestingModule } from '@nestjs/testing';
+import { FisFingerprintController } from './fis-fingerprint.controller';
+import { FisFingerprintService } from './fis-fingerprint.service';
+
+describe('FisFingerprintController', () => {
+  let fisFingerprintController: FisFingerprintController;
+
+  beforeEach(async () => {
+    const app: TestingModule = await Test.createTestingModule({
+      controllers: [FisFingerprintController],
+      providers: [FisFingerprintService],
+    }).compile();
+
+    fisFingerprintController = app.get<FisFingerprintController>(FisFingerprintController);
+  });
+
+  describe('root', () => {
+    it('should return "Hello World!"', () => {
+      expect(fisFingerprintController.getHello()).toBe('Hello World!');
+    });
+  });
+});

+ 12 - 0
apps/fis-fingerprint/src/fis-fingerprint.controller.ts

@@ -0,0 +1,12 @@
+import { Controller, Get } from '@nestjs/common';
+import { FisFingerprintService } from './fis-fingerprint.service';
+
+@Controller()
+export class FisFingerprintController {
+  constructor(private readonly fisFingerprintService: FisFingerprintService) {}
+
+  @Get()
+  getHello(): string {
+    return this.fisFingerprintService.getHello();
+  }
+}

+ 10 - 0
apps/fis-fingerprint/src/fis-fingerprint.module.ts

@@ -0,0 +1,10 @@
+import { Module } from '@nestjs/common';
+import { FisFingerprintController } from './fis-fingerprint.controller';
+import { FisFingerprintService } from './fis-fingerprint.service';
+
+@Module({
+  imports: [],
+  controllers: [FisFingerprintController],
+  providers: [FisFingerprintService],
+})
+export class FisFingerprintModule {}

+ 8 - 0
apps/fis-fingerprint/src/fis-fingerprint.service.ts

@@ -0,0 +1,8 @@
+import { Injectable } from '@nestjs/common';
+
+@Injectable()
+export class FisFingerprintService {
+  getHello(): string {
+    return 'Hello World!';
+  }
+}

+ 8 - 0
apps/fis-fingerprint/src/main.ts

@@ -0,0 +1,8 @@
+import { NestFactory } from '@nestjs/core';
+import { FisFingerprintModule } from './fis-fingerprint.module';
+
+async function bootstrap() {
+  const app = await NestFactory.create(FisFingerprintModule);
+  await app.listen(process.env.port ?? 3000);
+}
+bootstrap();

+ 24 - 0
apps/fis-fingerprint/test/app.e2e-spec.ts

@@ -0,0 +1,24 @@
+import { Test, TestingModule } from '@nestjs/testing';
+import { INestApplication } from '@nestjs/common';
+import * as request from 'supertest';
+import { FisFingerprintModule } from './../src/fis-fingerprint.module';
+
+describe('FisFingerprintController (e2e)', () => {
+  let app: INestApplication;
+
+  beforeEach(async () => {
+    const moduleFixture: TestingModule = await Test.createTestingModule({
+      imports: [FisFingerprintModule],
+    }).compile();
+
+    app = moduleFixture.createNestApplication();
+    await app.init();
+  });
+
+  it('/ (GET)', () => {
+    return request(app.getHttpServer())
+      .get('/')
+      .expect(200)
+      .expect('Hello World!');
+  });
+});

+ 9 - 0
apps/fis-fingerprint/test/jest-e2e.json

@@ -0,0 +1,9 @@
+{
+  "moduleFileExtensions": ["js", "json", "ts"],
+  "rootDir": ".",
+  "testEnvironment": "node",
+  "testRegex": ".e2e-spec.ts$",
+  "transform": {
+    "^.+\\.(t|j)s$": "ts-jest"
+  }
+}

+ 9 - 0
apps/fis-fingerprint/tsconfig.app.json

@@ -0,0 +1,9 @@
+{
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "declaration": false,
+    "outDir": "../../dist/apps/fis-fingerprint"
+  },
+  "include": ["src/**/*"],
+  "exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
+}

+ 1 - 19
nest-cli.json

@@ -14,7 +14,7 @@
       "type": "application",
       "root": "apps/fis-fingerprint",
       "entryFile": "main",
-      "sourceRoot": "apps/fis-fingerprint/src",
+      "sourceRoot": "apps/fis-fingerprint",
       "compilerOptions": {
         "tsConfigPath": "apps/fis-fingerprint/tsconfig.app.json"
       }
@@ -27,24 +27,6 @@
       "compilerOptions": {
         "tsConfigPath": "apps/fis-verification/tsconfig.app.json"
       }
-    },
-    "microservices": {
-      "type": "application",
-      "root": "apps/microservices",
-      "entryFile": "main",
-      "sourceRoot": "apps/microservices/src",
-      "compilerOptions": {
-        "tsConfigPath": "apps/microservices/tsconfig.app.json"
-      }
-    },
-    "verification": {
-      "type": "application",
-      "root": "apps/verification",
-      "entryFile": "main",
-      "sourceRoot": "apps/verification/src",
-      "compilerOptions": {
-        "tsConfigPath": "apps/verification/tsconfig.app.json"
-      }
     }
   }
 }