Node JS sample app for Akamai Fast purge and Media Service On Demand Content Preparation transcoding callback endpoint
Node JS running on Raspberry Pi to demonstrate the following features:
- Fast purging
- MSOD Transcoding webhook/callback upon transcoding job completion
Built a small node/express app to run the MOSCA MQTT broker (mosca.io) and display over http the current count of mqtt clients connected. I then setup an Akamai delivery config in front of this origin and configured sureroute-test-object as well as page caching to cache the page for 365 days. Not knowing when mqtt clients count could change (could be every seconds or every 6 months), I then use the Akamai Fast Purge to trigger invalidation upon client count change, caching for as long as possible but quickly purging upon change. Edgegrid library provides everything needed => https://github.com/akamai/AkamaiOPEN-edgegrid-node That should solve most concerns around the so called uncacheable but super popular content.
As part of a simple video on demand workflow, we often setup a watch folder on Netstorage to then trigger transcoding jobs This is well documented in Luna but wanted to have a working demo of the callback feature that you define in the MSOD assistant in Luna Control Center. I added a couple of endpoints to listen to the calls made by the transcoding workflow engine to illustrate the data points a customer could expect upon each stage of a job completion. It doesn't nothing more than displaying the content of the JSON returned.
- mosca
- express
- edgegrid
- body-parser
- download repository
- run "npm install"
- Follow Edgegrid setup to obtain your egdegrid settings and put them in akamai/.edgerc
- Stand up an Akamai config for a hostname of your choice and update line 33 of main.js
- node main.js