Serve your markdown posts as a REST api instantly
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Markdown To API

I had a problem with jekyll and wanted to move to a more "front-end agnostic" solution. What this script does is takes all your markdown posts, parses the markdown and front-matter with gray-matter, stores it into a json file with node-json-db and serves it over an API with json-server.

Usage Instructions

It's a little messy for now, I plan on turning it into a command line utility, but will need a little more time for that. At the moment, it's designed for Jeykll front matter, so it pulls in stuff like date_published, I'm going to modify it so that it just pulls all the front-matter

To make it work with more than just jekyll, it now pulls all the front matter into a matter object, so to get the title, where you used to just get title, you would have to type matter.title, a small price to have to pay to get it to play nice with all types of markdown front-matter.

  • Copy all your .md files to this directory
  • run chmod +x to give the script execution privs
  • npm run migrate will migrate your posts and serve them

Additionally, if you don't want to remigrate your posts into the database, you can just run npm run serve to serve them.