merge into lino sam

This commit is contained in:
TheManus88
2024-06-06 21:21:58 -06:00
8 changed files with 573 additions and 64 deletions
+504 -60
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -21,10 +21,13 @@
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.2",
"@nestjs/core": "^10.0.0",
"@nestjs/jwt": "^10.2.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/typeorm": "^10.0.2",
"mysql2": "^3.10.0",
"bcrypt": "^5.1.1",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
+8
View File
@@ -0,0 +1,8 @@
/*
https://docs.nestjs.com/controllers#controllers
*/
import { Controller } from '@nestjs/common';
@Controller()
export class ProfesorController {}
+12
View File
@@ -0,0 +1,12 @@
/*
https://docs.nestjs.com/modules
*/
import { Module } from '@nestjs/common';
@Module({
imports: [],
controllers: [],
providers: [],
})
export class ProfesorModule { }
+8
View File
@@ -0,0 +1,8 @@
/*
https://docs.nestjs.com/providers#services
*/
import { Injectable } from '@nestjs/common';
@Injectable()
export class ProfesorService {}
+5 -1
View File
@@ -1,12 +1,16 @@
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { ConfigService } from '@nestjs/config';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
constructor(private readonly appService: AppService,
private configservice: ConfigService
) {}
@Get()
getHello(): string {
console.log("Todo bien", this.configservice.get("DATABASE_NAME"))
return this.appService.getHello();
}
}
+30 -3
View File
@@ -1,12 +1,39 @@
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 { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';
import { TypeOrmModule } from '@nestjs/typeorm';
@Module({
imports: [AuthModule, UsersModule],
controllers: [AppController],
providers: [AppService],
imports: [
AuthModule,
UsersModule,
ConfigModule.forRoot({
envFilePath: '.env',
isGlobal: true,
}),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: async (configservice: ConfigService) => ({
type: 'mariadb',
host: configservice.get('DB_HOST'),
port: configservice.get('DB_PORT'),
username: configservice.get('DB_USER'),
password: configservice.get('DB_PASSWORD'),
database: configservice.get('DB_DATABASE'),
entities: [],
synchronize: configservice.get('DB_SYNCRONIZE'),
}),
}),
ProfesorModule,
],
controllers: [ProfesorController, AppController],
providers: [ProfesorService, AppService],
})
export class AppModule {}
+3
View File
@@ -1,8 +1,11 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
@Injectable()
export class AppService {
getHello(): string {
console.log("Todo bien")
return 'Hello World!';
}
}