mirror of
https://github.com/tedkulp/vidgrab
synced 2026-04-20 21:44:25 -04:00
Back to nextjs
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user