Back to nextjs

This commit is contained in:
2021-07-31 17:47:08 -04:00
parent edbfd8bb9e
commit b22eb01ca9
61 changed files with 18390 additions and 2373 deletions
+8 -3
View File
@@ -1,13 +1,15 @@
import { InjectQueue } from '@nestjs/bull';
import {
Body,
CacheInterceptor,
CacheTTL,
Controller,
Get,
HttpCode,
Logger,
Post,
Render,
Req,
UseInterceptors,
UsePipes,
ValidationPipe,
} from '@nestjs/common';
@@ -28,8 +30,9 @@ export class WebController {
private readonly eventEmitter: EventEmitter2,
) {}
@Get()
@Render('Index')
@Get('/info')
// @Render('Index')
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async root(@Req() request: any) {
const fullUrl =
request.protocol + '://' + request.get('host') + request.originalUrl;
@@ -75,6 +78,8 @@ export class WebController {
}
@Get('/extractors')
@UseInterceptors(CacheInterceptor)
@CacheTTL(600)
async listExtractors() {
const extractors = await this.ytdlService.listExtractors();
+2 -1
View File
@@ -1,5 +1,5 @@
import { BullModule } from '@nestjs/bull';
import { Module } from '@nestjs/common';
import { CacheModule, Module } from '@nestjs/common';
import { YtdlModule } from '../ytdl/ytdl.module';
import { WebController } from './web.controller';
@@ -9,6 +9,7 @@ import { WebController } from './web.controller';
BullModule.registerQueue({
name: 'vidgrab',
}),
CacheModule.register(),
YtdlModule,
],
controllers: [WebController],