129 lines
3.7 KiB
Plaintext
129 lines
3.7 KiB
Plaintext
import { Module } from '@nestjs/common';
|
|
import { AppController } from './app.controller';
|
|
import { AppService } from './app.service';
|
|
import { AdminModule } from './admin/admin.module';
|
|
import {TypeOrmModule } from '@nestjs/typeorm'
|
|
import { PostsModule } from './posts/posts.module';
|
|
import { TipoUserModule } from './tipo_user/tipo_user.module';
|
|
import { EventoModule } from './evento/evento.module';
|
|
import { ParticipanteModule } from './participante/participante.module';
|
|
import { QrModule } from './qr/qr.module';
|
|
import { AdministradorModule } from './administrador/administrador.module';
|
|
import { AsistenciaModule } from './asistencia/asistencia.module';
|
|
import { ParticipanteEventoModule } from './participante_evento/participante_evento.module';
|
|
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forRoot({
|
|
type: 'mysql',
|
|
host: 'localhost',
|
|
port: 3306, //3306
|
|
username: 'root',
|
|
password: 'admin', //admin
|
|
database: 'nestdb',
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: true,
|
|
//extra
|
|
retryAttempts: 10, // Intentos para reconectar
|
|
retryDelay: 3000, // Tiempo entre reintentos
|
|
}),
|
|
AdminModule,
|
|
PostsModule,
|
|
EventoModule,
|
|
TipoUserModule,
|
|
ParticipanteModule,
|
|
QrModule,
|
|
AdministradorModule,
|
|
AsistenciaModule,
|
|
ParticipanteEventoModule,
|
|
],
|
|
controllers: [AppController],
|
|
providers: [AppService],
|
|
})
|
|
export class AppModule {}
|
|
|
|
//
|
|
|
|
{
|
|
"name": "nestjs-mysql",
|
|
"version": "0.0.1",
|
|
"description": "",
|
|
"author": "",
|
|
"private": true,
|
|
"license": "UNLICENSED",
|
|
"scripts": {
|
|
"build": "nest build",
|
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
"start": "nest start",
|
|
"start:dev": "nest start --watch",
|
|
"start:debug": "nest start --debug --watch",
|
|
"start:prod": "node dist/main",
|
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"test:cov": "jest --coverage",
|
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
},
|
|
"dependencies": {
|
|
"@nestjs/common": "^11.0.1",
|
|
"@nestjs/core": "^11.0.1",
|
|
"@nestjs/platform-express": "^11.0.1",
|
|
"@nestjs/swagger": "^11.1.0",
|
|
"@nestjs/typeorm": "^11.0.0",
|
|
"class-transformer": "^0.5.1",
|
|
"class-validator": "^0.14.1",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"mysql2": "^3.13.0",
|
|
"reflect-metadata": "^0.2.2",
|
|
"rxjs": "^7.8.1",
|
|
"swagger-ui-express": "^5.0.1",
|
|
"typeorm": "^0.3.21"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/eslintrc": "^3.2.0",
|
|
"@eslint/js": "^9.18.0",
|
|
"@nestjs/cli": "^11.0.0",
|
|
"@nestjs/schematics": "^11.0.0",
|
|
"@nestjs/testing": "^11.0.1",
|
|
"@swc/cli": "^0.6.0",
|
|
"@swc/core": "^1.10.7",
|
|
"@types/express": "^5.0.0",
|
|
"@types/jest": "^29.5.14",
|
|
"@types/node": "^22.10.7",
|
|
"@types/supertest": "^6.0.2",
|
|
"eslint": "^9.18.0",
|
|
"eslint-config-prettier": "^10.0.1",
|
|
"eslint-plugin-prettier": "^5.2.2",
|
|
"globals": "^16.0.0",
|
|
"jest": "^29.7.0",
|
|
"prettier": "^3.4.2",
|
|
"source-map-support": "^0.5.21",
|
|
"supertest": "^7.0.0",
|
|
"ts-jest": "^29.2.5",
|
|
"ts-loader": "^9.5.2",
|
|
"ts-node": "^10.9.2",
|
|
"tsconfig-paths": "^4.2.0",
|
|
"typescript": "^5.7.3",
|
|
"typescript-eslint": "^8.20.0"
|
|
},
|
|
"jest": {
|
|
"moduleFileExtensions": [
|
|
"js",
|
|
"json",
|
|
"ts"
|
|
],
|
|
"rootDir": "src",
|
|
"testRegex": ".*\\.spec\\.ts$",
|
|
"transform": {
|
|
"^.+\\.(t|j)s$": "ts-jest"
|
|
},
|
|
"collectCoverageFrom": [
|
|
"**/*.(t|j)s"
|
|
],
|
|
"coverageDirectory": "../coverage",
|
|
"testEnvironment": "node"
|
|
}
|
|
}
|