Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Kontent-ai-Learn/kontent-ai-learn-reference-preprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

master develop

Kontent.ai Learn - Reference Preprocessor

Backend function for Kontent.ai Learn that uses Kontent.ai as a source of its data.

The service is responsible for fetching all the content related to API Reference pages on the documentation portal, and passing it forward using Azure Blob Storage.

Overview

  1. This project is a TypeScript Azure Functions application.
  2. It reacts to Event Grid events (update and get endpoints).
  3. The function fetches content related to API Reference pages using Kontent.ai Delivery SDK for Javascript.
  4. The fetched content is then resolved and processed into a simplified JSON format.
  5. Finally, it saves the processed data to an Azure Blob Storage, where the following API Reference services can access it.

Setup

Prerequisites

  1. Node (+yarn) installed
  2. Visual Studio Code installed
  3. Subscriptions on Kontent.ai

Instructions

  1. Open Visual Studio Code and install the prerequisites according to the following steps.
  2. Log in to Azure using the Azure Functions extension tab.
  3. Clone the project repository and open it in Visual Studio Code.
  4. Run yarn install in the terminal.
  5. Set the required keys.
  6. Deploy to Azure using Azure Functions extension tab, or run locally by pressing Ctrl + F5 in Visual Studio Code.

Required Keys

  • KC.ProjectId - Kontent.ai project ID
  • KC.PreviewApiKey - Kontent.ai Delivery Preview API key
  • KC.SecuredApiKey - Kontent.ai Delivery Secured API key
  • Azure.StorageKey - Azure Storage key
  • Azure.StorageAccountName - Azure Storage account name
  • Azure.ContainerName - Azure Storage container name
  • DocsWebsiteUrl - Kontent.ai Learn URL
  • EventGrid.TriggerReferenceUpdateStarter.Endpoint - Event Grid endpoint for Blob Provider's ReferenceUpdateStarter function
  • EventGrid.TriggerReferenceUpdateStarter.Key - Event Grid topic authentication key

Testing

  • Run yarn run test in the terminal.

How To Contribute

Feel free to open a new issue where you describe your proposed changes, or even create a new pull request from your branch with proposed changes.

License

All the source codes are published under MIT license.