25daysofserverless Day 12
Azure Function App
I thought I would be done quickly with this Function App, as PowerShell has a ConvertFrom-Markdown cmdlet. Only I could not get it to work within the function. Locally there was no problem. But when running the debug mode or deploying to Azure... No luck. I suspect this to be a bug in the cmdlet.
I spend some time with everything surrounding the function app. So you can call it as a restcall or in a browser, by adding the GistID. It can show you a HTML page, or the raw html file. You switch between those by adding "Raw=true" to the URL. If multiple files are in the gist, it combines multiple files in one output.
Call the function
For example, you can use this url in your browser:
(click it, is will give you a picture of my dog!)
This is based on the following Gist: https://gist.github.com/Ba4bes/0cc1640aabf9825ebd4fd727e8c72591.
To view the HTML, Add "Raw=true" to the URL: https://4besday12.azurewebsites.net/api/GistToWeb?GistID=0cc1640aabf9825ebd4fd727e8c72591&Raw=true
Thursday, 12 December Today in London, Simona wants to send beautiful holiday cards to all her friends But since she's worried they won't arrive in time, she doesn't want to hand-write and mail each individual letter!
Instead, she wants to make each of her friends a personalized website containing a holiday letter for them! She plans on writing each letter as its own Markdown file, and needs a way to turn those into websites.
Create a service that reads Markdown text from GitHub (perhaps using the Gist API), parses the Markdown to HTML, and returns the HTML to the client.
As a bonus challenge: reading and parsing Markdown is a lot of work! To optimize, cache your responses and send cached versions of the processed Markdown.
This app is running on an Azure Function App with PowerShell. Want to find out more about creating your own? Click here