diff --git a/package.json b/package.json index 7870fc6..c8c3861 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", - "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"", - "lint-fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "lint": "eslint \"src/**/*.ts\"", + "lint-fix": "eslint \"src/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", diff --git a/src/app.module.ts b/src/app.module.ts index 11f54fd..2d23b8c 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -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 {}