Git Product home page Git Product logo

aka's Introduction

Azure serverless URL shortening service

An Azure function implementing a URL shortening service backed by Azure blob storage in the fewest lines of code possible (~70 LoC).

Read the announcement

Installing

  1. Fork the repo
  2. Create an Azure Functions app for it
  3. Add an X-Authorization setting containing a shared key used for creating the short links
  4. Add automated deployment from the repo

The short URLs will be persisted in the same Azure storage account used by the app, in a table named Aka.

Usage

The function provides a REST API for URL shortening, as well as the resolving itself. All mutating operations (POST, PUT, DELETE) require the client providing an X-Authorization value that needs to match the setting configured server-side (that is, a shared key/secret).

Usage is trivial: just POST or PUT to the desired short URL you want, passing the target URL in the body, like so:

# create or update shortlink
curl -d [TARGET_URL] -H "X-Authorization: [SHARED_SECRET]" https://[FUNCTION_APP_URL]/[SHORT_ALIAS]

The X-Authorization must match what you specified in step 3 during install/configuration.

That's it.

Example redirection stats badge:

redirects badge

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.