sungjin

Add module exports

...@@ -2,11 +2,13 @@ import { Module } from '@nestjs/common'; ...@@ -2,11 +2,13 @@ import { Module } from '@nestjs/common';
2 import { AuthController } from './auth.controller'; 2 import { AuthController } from './auth.controller';
3 import { PrismaModule } from 'nestjs-prisma'; 3 import { PrismaModule } from 'nestjs-prisma';
4 import { AuthService } from './auth.service'; 4 import { AuthService } from './auth.service';
5 -import { JwtModule, JwtService } from '@nestjs/jwt'; 5 +import { JwtModule } from '@nestjs/jwt';
6 +import { RunnerService } from 'src/runner/runner.service';
6 7
7 @Module({ 8 @Module({
8 imports: [PrismaModule, JwtModule.register({ secret: 'secret' })], 9 imports: [PrismaModule, JwtModule.register({ secret: 'secret' })],
9 controllers: [AuthController], 10 controllers: [AuthController],
10 - providers: [AuthService], 11 + providers: [AuthService, RunnerService, AuthService],
12 + exports: [AuthService],
11 }) 13 })
12 export class AuthModule {} 14 export class AuthModule {}
......
...@@ -3,6 +3,7 @@ import { AppModule } from './app.module'; ...@@ -3,6 +3,7 @@ import { AppModule } from './app.module';
3 3
4 async function bootstrap() { 4 async function bootstrap() {
5 const app = await NestFactory.create(AppModule); 5 const app = await NestFactory.create(AppModule);
6 - await app.listen(3000); 6 + app.enableCors();
7 + await app.listen(4000);
7 } 8 }
8 bootstrap(); 9 bootstrap();
......
1 import { Module } from '@nestjs/common'; 1 import { Module } from '@nestjs/common';
2 import { PrismaModule, PrismaService } from 'nestjs-prisma'; 2 import { PrismaModule, PrismaService } from 'nestjs-prisma';
3 +import { AuthModule } from 'src/auth/auth.module';
3 import { PostController } from './post.controller'; 4 import { PostController } from './post.controller';
4 import { PostService } from './post.service'; 5 import { PostService } from './post.service';
5 6
6 @Module({ 7 @Module({
7 - imports: [PrismaModule], 8 + imports: [PrismaModule, AuthModule],
8 controllers: [PostController], 9 controllers: [PostController],
9 providers: [PostService, PrismaService], 10 providers: [PostService, PrismaService],
11 + exports: [PostService],
10 }) 12 })
11 export class PostModule {} 13 export class PostModule {}
......
1 import { Module } from '@nestjs/common'; 1 import { Module } from '@nestjs/common';
2 -import { PrismaModule } from 'nestjs-prisma'; 2 +import { AuthModule } from 'src/auth/auth.module';
3 import { RunnerController } from './runner.controller'; 3 import { RunnerController } from './runner.controller';
4 import { RunnerService } from './runner.service'; 4 import { RunnerService } from './runner.service';
5 5
6 @Module({ 6 @Module({
7 - imports: [PrismaModule], 7 + imports: [AuthModule],
8 controllers: [RunnerController], 8 controllers: [RunnerController],
9 providers: [RunnerService], 9 providers: [RunnerService],
10 + exports: [RunnerService],
10 }) 11 })
11 export class RunnerModule {} 12 export class RunnerModule {}
......