institucion
This commit is contained in:
parent
d8102849f8
commit
2720f6319e
@ -3,6 +3,8 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { InstitucionModule } from './institucion/institucion.module';
|
||||
import { Institucion } from './institucion/institucion.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@ -17,10 +19,11 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
username: config.get<string>('USER_DB'),
|
||||
password: config.get<string>('PASSWORD_DB'),
|
||||
synchronize: true,
|
||||
entities: [],
|
||||
entities: [Institucion],
|
||||
};
|
||||
},
|
||||
}),
|
||||
InstitucionModule,
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
18
src/institucion/institucion.controller.spec.ts
Normal file
18
src/institucion/institucion.controller.spec.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { InstitucionController } from './institucion.controller';
|
||||
|
||||
describe('InstitucionController', () => {
|
||||
let controller: InstitucionController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [InstitucionController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<InstitucionController>(InstitucionController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
4
src/institucion/institucion.controller.ts
Normal file
4
src/institucion/institucion.controller.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller('institucion')
|
||||
export class InstitucionController {}
|
13
src/institucion/institucion.entity.ts
Normal file
13
src/institucion/institucion.entity.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
export class Institucion {
|
||||
@PrimaryGeneratedColumn()
|
||||
idInstitucion: string;
|
||||
|
||||
@Column()
|
||||
institucion: string;
|
||||
|
||||
@Column()
|
||||
logo: string;
|
||||
}
|
10
src/institucion/institucion.module.ts
Normal file
10
src/institucion/institucion.module.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { InstitucionController } from './institucion.controller';
|
||||
import { Institucion } from './institucion.entity';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Institucion])],
|
||||
controllers: [InstitucionController],
|
||||
})
|
||||
export class InstitucionModule {}
|
Loading…
Reference in New Issue
Block a user