GeoAIInterceptor
Optional interceptor that appends the Link header pointing to llms.txt on all responses from the decorated controller or handler.
Per-controller
typescript
import { Controller, UseInterceptors } from '@nestjs/common';
import { GeoAIInterceptor } from 'geo-ai-nest';
@Controller('products')
@UseInterceptors(GeoAIInterceptor)
export class ProductsController {
// All responses from this controller include the Link header
}Global
typescript
// main.ts
const app = await NestFactory.create(AppModule);
app.useGlobalInterceptors(app.get(GeoAIInterceptor));Via module config
Use injectLinkHeader: true in module config to inject the header via middleware on ALL routes without using the interceptor directly:
typescript
GeoAIModule.forRoot({
// ...
injectLinkHeader: true,
})