Page 411 - MDP2022-2
P. 411

}


            datasource  db  {
                provider  =  "mysql"
                url            =  "mysql://root@localhost:3306/mdp"
            }


            model  User  {
                id                Int                  @id  @default(autoincrement())
                userId        String            @unique
                nickname    String
                name            String
                email          String
                password    String
                createdAt  DateTime        @default(now())
                updatedAt  DateTime        @updatedAt
            }


            model  Queue  {
                id                Int                  @id  @default(autoincrement())
                name            String
                createdAt  DateTime        @default(now())
                reservationTime  DateTime
            }




            src/main.ts
            import  {  ValidationPipe  }  from  '@nestjs/common';
            import  {  NestFactory  }  from  '@nestjs/core';
            import  {  AppModule  }  from  './app.module';


            async  function  bootstrap()  {
                const  app  =  await  NestFactory.create(AppModule);
                app.useGlobalPipes(
                    new  ValidationPipe({
                        transform:  true,
                    }),
                );
                app.enableCors();
                await  app.listen(4500);
            }
            bootstrap();




            src/app.service.ts
   406   407   408   409   410   411   412   413   414   415   416