This describes how to deal with custom content types and hooks in a Meteor JS based webapp which pulls its content from Contentful.
My goal was to reload content into a Meteor server side collection and have it update any time a user on Contentful.com updated content there. Contentful provide a very helpful hook mechanism, whereby a POST request is made to an endpoint of your choosing when content has been updated.
I was using the server side component of IronRouter to listen for incoming POST requests from Contentful and when they arrived, the request body was empty. This is because Contentful have a custom content type 'application/vnd.contentful.management.v1+json' and IronRouter does not know how to deal with that out of the box.
I wrote the above, using the nodejs connect and the body parser module. Want to know how to include these in your Meteor app? Look at this handy package - https://github.com/meteorhacks/npm which allows you to include NPM modules in meteor.
Look at line 15 in the above cod