Fixed Linting Problems
This commit is contained in:
@@ -1,57 +1,57 @@
|
||||
import { Controller, Get, Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { INode, JWTToken, User, UserRole } from './entities';
|
||||
import FileSystemModule from './modules/filesystem';
|
||||
import { JWTAuthGuard, Role, RoleGuard } from './authguards';
|
||||
import AuthModule from './modules/auth';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { join } from 'path';
|
||||
|
||||
declare const PROD: boolean | undefined;
|
||||
|
||||
@Controller('test')
|
||||
class TestController {
|
||||
@Role(UserRole.USER)
|
||||
@Get('hello')
|
||||
getHello(): string {
|
||||
return 'UwU';
|
||||
}
|
||||
|
||||
@Role(UserRole.ADMIN)
|
||||
@Get('hello2')
|
||||
getHelloAdmin(): string {
|
||||
return 'UwU Admin';
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'sqlite',
|
||||
database: 'sqlite.db',
|
||||
synchronize: true,
|
||||
entities: [User, INode, JWTToken]
|
||||
}),
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath:
|
||||
typeof PROD !== 'undefined' && PROD
|
||||
? join(__dirname, 'frontend')
|
||||
: join(__dirname, '..', '..', 'frontend', 'dist'),
|
||||
exclude: ['/api*']
|
||||
}),
|
||||
FileSystemModule,
|
||||
AuthModule
|
||||
],
|
||||
controllers: [TestController],
|
||||
providers: [
|
||||
{
|
||||
provide: 'APP_GUARD',
|
||||
useClass: JWTAuthGuard
|
||||
},
|
||||
{
|
||||
provide: 'APP_GUARD',
|
||||
useClass: RoleGuard
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
import { Controller, Get, Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { INode, JWTToken, User, UserRole } from './entities';
|
||||
import FileSystemModule from './modules/filesystem';
|
||||
import { JWTAuthGuard, Role, RoleGuard } from './authguards';
|
||||
import AuthModule from './modules/auth';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { join } from 'path';
|
||||
|
||||
declare const PROD: boolean | undefined;
|
||||
|
||||
@Controller('test')
|
||||
class TestController {
|
||||
@Role(UserRole.USER)
|
||||
@Get('hello')
|
||||
getHello(): string {
|
||||
return 'UwU';
|
||||
}
|
||||
|
||||
@Role(UserRole.ADMIN)
|
||||
@Get('hello2')
|
||||
getHelloAdmin(): string {
|
||||
return 'UwU Admin';
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'sqlite',
|
||||
database: 'sqlite.db',
|
||||
synchronize: true,
|
||||
entities: [User, INode, JWTToken]
|
||||
}),
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath:
|
||||
typeof PROD !== 'undefined' && PROD
|
||||
? join(__dirname, 'frontend')
|
||||
: join(__dirname, '..', '..', 'frontend', 'dist'),
|
||||
exclude: ['/api*']
|
||||
}),
|
||||
FileSystemModule,
|
||||
AuthModule
|
||||
],
|
||||
controllers: [TestController],
|
||||
providers: [
|
||||
{
|
||||
provide: 'APP_GUARD',
|
||||
useClass: JWTAuthGuard
|
||||
},
|
||||
{
|
||||
provide: 'APP_GUARD',
|
||||
useClass: RoleGuard
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user