You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Writing routes in Next.js which will return feeds generated by this library, but unsure
what headers to send with the response.
Describe the solution you'd like
The current .rss2(), .atom1() and .json1() functions just return a string. Would be great if there were alternatives to those which simply returned standard Response objects with the rendered feed as the body and appropriate headers already setup.
Describe alternatives you've considered
Can of course just do it manually, like everyone else using this are probably doing, but I'm guessing that serving the rendered string from a server is probably one of the most common things to do with this library, so would be great if this could be handled right out of the box. 🧙♂️
The text was updated successfully, but these errors were encountered:
Proper type for RSS is application/rss+xml. IMO you bring up a valid concern: users are not sure which content type headers to match to different feed outputs, and most uses of this library will at some point involve serving its output, whether it be through a Node server or through Apache or Nginx as the output of a Node static site generator.
But I think the solution would simply be to add a Serving feeds section in the docs mentioning the matching content types OR to change the output of the feed methods to return an object with properties, eg const returnValue = new String('...'); returnValue.contentType = 'application/rss+xml' (using new String in example to avoid breaking change)
Cache headers IMO are out of scope for a data-format rendering library
Is your feature request related to a problem? Please describe.
Writing routes in Next.js which will return feeds generated by this library, but unsure
what headers to send with the response.
Describe the solution you'd like
The current
.rss2()
,.atom1()
and.json1()
functions just return a string. Would be great if there were alternatives to those which simply returned standardResponse
objects with the rendered feed as the body and appropriate headers already setup.Describe alternatives you've considered
Can of course just do it manually, like everyone else using this are probably doing, but I'm guessing that serving the rendered string from a server is probably one of the most common things to do with this library, so would be great if this could be handled right out of the box. 🧙♂️
The text was updated successfully, but these errors were encountered: