21 lines
618 B
TypeScript
21 lines
618 B
TypeScript
import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common';
|
|
import { DomainrproxyService } from './domainrproxy.service';
|
|
import { AuthGuard } from 'src/auth/auth.guard';
|
|
|
|
@Controller('domainrproxy')
|
|
export class DomainrproxyController {
|
|
constructor(private readonly proxyService: DomainrproxyService) {}
|
|
|
|
@UseGuards(AuthGuard)
|
|
@Get(':domain')
|
|
queryDomain(@Param('domain') domain: string) {
|
|
return this.proxyService.queryForDomain(domain);
|
|
}
|
|
|
|
@UseGuards(AuthGuard)
|
|
@Post('search')
|
|
search(@Body() body: { query: string }) {
|
|
return this.proxyService.search(body.query);
|
|
}
|
|
}
|