From 6418bff35cf1b0df8b58ae8d5b7251280185d636 Mon Sep 17 00:00:00 2001 From: Chip Wasson Date: Wed, 30 Oct 2024 10:32:44 -0600 Subject: [PATCH] Add headers endpoint --- src/app.controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app.controller.ts b/src/app.controller.ts index cce879e..b8e8c65 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Get } from '@nestjs/common'; +import { Controller, Get, Req } from '@nestjs/common'; import { AppService } from './app.service'; @Controller() @@ -9,4 +9,9 @@ export class AppController { getHello(): string { return this.appService.getHello(); } + + @Get('headers') + getHeaders(@Req() req: Request) { + return req.headers; + } }