1.0.7 • Published 3 years ago

@pinknews/nestjs_rss_interceptor v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago