Realizing that JSON has become the de facto goto format for APIs these days, Brent Simmons and Manton Reece recently released the JSON Feed format.
I like this, and when it came out, I added it to my various blogs, including this one. Today, I decided to finally get around to writing about implementing it, so here we are.
Since this blog is running as an express.js app with Ghost as middleware, adding the JSON feed was pretty easy.
I used a variation of the feed2json repo, and added a route for
First, I added the rule to
Then I created a file called
If you look at line 31, I've hard coded the RSS URL to encode, you can modify this to be passed via ENV variable instead or however you want, but for my purposes, this worked nicely.
Then, in the header of the site I added:
You can view the JSON feed for Coded Geekery here.
This site is using Ghost via middleware so I can add other features to it as well, like the JSON feed, the jobs feed, and a few other backend things I have happening.