Some refactoring.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import { Controller, Get, Session, UseGuards } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
import { AuthGuard } from './auth.guard';
|
||||
import { AuthGuard } from './auth/guards/auth.guard';
|
||||
import { SessionContainer } from "supertokens-node/recipe/session";
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
return "API";
|
||||
}
|
||||
|
||||
@Get('test')
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
@@ -20,6 +19,6 @@ import { ConfigModule } from '@nestjs/config';
|
||||
}),
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
providers: [],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getHello(): string {
|
||||
return 'Hello World!';
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
Module,
|
||||
NestModule,
|
||||
} from '@nestjs/common';
|
||||
import { AuthMiddleware } from './auth.middleware';
|
||||
import { AuthModuleConfig, ConfigInjectionToken } from './config.interface';
|
||||
import { AuthMiddleware } from './middlewares/auth.middleware';
|
||||
import { AuthModuleConfig, ConfigInjectionToken } from './interfaces/config.interface';
|
||||
import { SupertokensService } from './supertokens/supertokens.service';
|
||||
|
||||
@Module({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { AuthModuleConfig, ConfigInjectionToken } from '../config.interface';
|
||||
import { AuthModuleConfig, ConfigInjectionToken } from '../interfaces/config.interface';
|
||||
import supertokens from 'supertokens-node';
|
||||
import ThirdPartyEmailPassword from 'supertokens-node/recipe/thirdpartyemailpassword';
|
||||
import EmailPassword from 'supertokens-node/recipe/emailpassword';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import supertokens from 'supertokens-node';
|
||||
import { SupertokensExceptionFilter } from './auth/auth.filter';
|
||||
import { SupertokensExceptionFilter } from './auth/filters/auth.filter';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
Reference in New Issue
Block a user