Giter VIP home page Giter VIP logo

durable-registry's Introduction

Durable Registry

This is a solution for Day 21 of the 25 Days of Serverless.

Free Azure Get your free Azure account

Quick Start

To run the solution locally, be sure you have installed:

Helpful, "good to have":

  1. Fork the repo (optional)
  2. Clone the repo: git clone https://github.com/JeremyLikness/durable-registry.git (change to your forked repo if necessary)
  3. Navigate to the src directory
  4. Add a local.settings.json and configure it to use the emulator:
    {
            "IsEncrypted": false,
            "Values": {
                    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
                    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
            }
    }
  5. Restore, build, and publish the app in one step, execute dotnet publish
  6. Change to the publish directory: cd bin\Debug\netcoreapp2.2\publish
  7. Copy the local settings: cp ../../../../local.settings.json .
  8. Start the Azure Storage Emulator
  9. Launch the functions app: func host start

Using the APIs

You can access the APIs directly from your browser or by using your favorite REST client tool (I prefer HTTP-REPL, listed above). All of the solution endpoints use the GET verb to make the example as easy as possible to use.

API Example

Open a new registry

http(s)://{endpoint}/api/Open

This will return a unique id. You have 5 minutes from the time you open a registry to add items and/or close it. A closed or timed out registry will not accept new entries.

Add an item to a registry

http(s)://{endpoint}/api/Add/{id}?item={item name}

You will receive 200 - OK if the registry is valid and open.

Finish (close) a registry

http(s)://{endpoint}/api/Finish/{id}

Once closed, you can no longer add items to the registry.

List the status and items in a registry

https(s)://{endpoint}/api/Peek/{id}

If a valid registry id is passed, this will return the status (open or closed) and items in the registry.

List overall status

http(s)://{endpoint}/api/Stats

This will show a count of all registries (open and closed) and a total count of items across all registries.

Learn More

You can learn more about the solution by reading the related blog post.

๐Ÿ‘‰ Free Durable Functions Hands-on Lab

๐Ÿ‘‰ Durable Functions Documentation

๐Ÿ‘‰ Function Entities Documentation

Regards,

Jeremy Likness

durable-registry's People

Contributors

jeremylikness avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.