Skip to content

TedMwai/serverless-qr-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure QR Code Generator

This repository contains the code for serverless Azure Function that generates QR codes for provided URLs and stores them in Azure Blob Storage. The function is written in JavaScript and can be triggered via HTTP requests.

Demo

Send a GET request to the Azure Function https://azure-qr-code.azurewebsites.net/api/GenerateQRCode with url as parameter.

curl example:

curl -X GET https://azure-qr-code.azurewebsites.net/api/GenerateQRCode -H "Content-Type: application/json" -d '{"url":"https://www.google.com"}'

Architecture

Azure QR Code Generator Architecture

Features

  • Serverless: Leverages Azure Functions for minimal infrastructure management.
  • QR Code Generation: Dynamically creates QR codes for any given URL.
  • Azure Blob Storage: Stores the generated QR codes in the cloud for easy access and management.

Prerequisites

Getting Started

1. Clone the Repository

git clone https://github.com/TedMwai/serverless-qr-code.git
cd serverless-qr-code/qrCodeGenerator

2. Install Dependencies

npm install

3. Local Configuration

Set up your local.settings.json file with the necessary configuration values:

{
    "IsEncrypted": false,
    "Values": {
        "AzureWebJobsStorage": "",
        "FUNCTIONS_WORKER_RUNTIME": "node",
	      "STORAGE_CONNECTION_STRING":"<YOUR_STORAGE_CONNECTION_STRING>"
    }
}

4. Running Locally

To start the function app locally, make sure you have Azure Functions Core Tools installed, then run:

func start

5. Deploy to Azure

Deploy your function app to Azure using the following command:

func azure functionapp publish <YOUR_FUNCTION_APP_NAME>

Usage

Send a GET request to your function's endpoint with a JSON payload containing the URL:

curl -X GET https://<YOUR_FUNCTION_URL>/api/GenerateQRCode -H "Content-Type: application/json" -d '{"url":"https://www.google.com"}'

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors