1.0.7 • Published 2 years ago

@pinknews/nestjs_rss_interceptor v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

This adds a RssInterceptor, which deals with turning a data blob from your controller to valid rss compliant xml.

Your controller should return a RssChannel instance, which mirrors the rss spec https://validator.w3.org/feed/docs/rss2.html.

@Controller()
export class RssController {
    @Get('rss')
    @UseInterceptors(RssInterceptor)
    getRss() {
        return {
            title: 'My RSS feed',
            description: 'This is my rss feed',
            link: 'http://example.com/rss',
            items: [
                {
                    title: 'This is item 1 in the feed',
                    description: 'This is longer description of how this is item 1 in the feed',
                    link: 'http://example.com/rss/1',
                },
                {
                    title: 'This is item 2. It's a bit simpler'
                }
            ]
        };
    }
}
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago