Controlador

This commit is contained in:
TioSam77
2024-06-07 13:14:04 -06:00
parent b030a4f321
commit 3c1b231c0d
15 changed files with 367 additions and 41 deletions
-8
View File
@@ -1,8 +0,0 @@
/*
https://docs.nestjs.com/controllers#controllers
*/
import { Controller } from '@nestjs/common';
@Controller()
export class ProfesorController {}
-12
View File
@@ -1,12 +0,0 @@
/*
https://docs.nestjs.com/modules
*/
import { Module } from '@nestjs/common';
@Module({
imports: [],
controllers: [],
providers: [],
})
export class ProfesorModule { }
-8
View File
@@ -1,8 +0,0 @@
/*
https://docs.nestjs.com/providers#services
*/
import { Injectable } from '@nestjs/common';
@Injectable()
export class ProfesorService {}
+10 -9
View File
@@ -1,12 +1,15 @@
import { ProfesorModule } from './Profesor/profesor.module';
import { ProfesorController } from './Profesor/profesor.controller';
import { ProfesorService } from './Profesor/profesor.service';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { join } from 'path';
import { UserController } from './modules/user/user.controller';
import { UserController } from './module/user/user.controller';
import { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';
import { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';
import { AuthModule } from './auth/auth.module';
@Module({
imports: [
@@ -27,10 +30,8 @@ import { join } from 'path';
entities: [],
synchronize: configservice.get("DB_SYNCRONIZE")
})
}),ProfesorModule],
controllers: [
ProfesorController, AppController],
providers: [
ProfesorService, AppService],
}), AuthModule, UsersModule],
controllers: [AppController, UserController],
providers: [AppService],
})
export class AppModule { }
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthController } from './auth.controller';
describe('AuthController', () => {
let controller: AuthController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [AuthController],
}).compile();
controller = module.get<AuthController>(AuthController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
+4
View File
@@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';
@Controller('auth')
export class AuthController {}
+9
View File
@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
@Module({
controllers: [AuthController],
providers: [AuthService]
})
export class AuthModule {}
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthService } from './auth.service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [AuthService],
}).compile();
service = module.get<AuthService>(AuthService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
+4
View File
@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class AuthService {}
View File
+7
View File
@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { UsersService } from './users.service';
@Module({
providers: [UsersService]
})
export class UsersModule {}
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { UsersService } from './users.service';
describe('UsersService', () => {
let service: UsersService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UsersService],
}).compile();
service = module.get<UsersService>(UsersService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
+4
View File
@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class UsersService {}