Create a blog in a subdirectory with Meteor JS
This post is about something very specific but probably not rare. And if I would have found this information prior to starting my project, it would have saved me a few days of spinning my wheels.
My situation and requirements
The requirements were very specific:
- Had an existing Node.js / Meteor.js Application
- Needed a new Blog / CMS to replace our custom built blog
- Wanted our new Blog / CMS to live in a subdirectory -- www.joinit.org/blog -- to take advantage of our domain existing authority
- The Node.js / Meteor.js application still has to run on the domain: www.joinit.org
Most popular approaches didn't work
There are a lot of popular CMS platforms to create a blog and I was eager to try them out!
Previously when I've needed to set up a CMS , I've used WordPress. However for this case, it's not possible (or at least, not within my knowledge) to run a WordPress instance within the subdirectory of an existing Node.js / Meteor.js app. So that didn't work.
So I moved on to evaluating another platform that I wanted to learn more about: Ghost CMS
So I dove into Ghost's docs and installed Ghost locally. It was quick to set up, well documented, and fun to learn! However, evaluating Ghost was where I spent the most unproductive time since I ultimately wasn't able to run Ghost in a directory of my existing application.
The solution
TL;DR: To meet my requirement of hosting in a subdirectory, I ended up going with a Headless CMS called ButterCMS. This gave the ability to manage content in an external dashboard (so my colleagues can have access and I no longer have to maintain a custom admin interface), while still integrating the content into a subdirectory: https://www.joinit.org/blog
What is a Headless CMS?
A Headless CMS is a service that abstracts the expected 'content management' utility away from how the content is displayed. So you have a service like ButterCMS that allows you to created, edit, and delete blog posts - but it leaves the rendering and display of the content to the developer (me). When starting this project, I wasn't familiar with the distinction between a Traditional CMS vs Headless CMS vs Decoupled CMS - so when I learned about a Headless CMS, it was obvious that this was the solution that I was looking for.
So now, Join It's blog is powered by an external CMS and we make APIs calls to power in the content (and because of the work that our Headless CMS does with caching and their CDN, it's faster to retrieve external results via API than it is to fetch/load from our own db).
If you want to peak, here are the docs for ButterCMS: https://buttercms.com/
If you're looking to add a blog in a subdirectory to your existing Node.js / Meteor.js app, then I'd highly recommend skipping straight to adding a Headless CMS. :)