Code Monkey home page Code Monkey logo

nwn-server-status-functions's Introduction

NwnServerStatus.Functions

Exploring Azure Durable Functions by polling for game servers with Beamdog's NWMasterJsonApi.

Requirements

Setup

Clone the repository and follow these steps.

1. Add local.settings.json

Required to run Azure Functions locally. You may simply copy-paste the following for development runtime.

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  }
}

2. AzureWebJobsStorage

Azure Functions requires a storage to store its state. I recommend using azurite for this locally, but you can also choose to use a live storage account on Azure.

a. Using an Azure Storage Account

If you have an Azure Storage Account available and wish to use it, add its connection string as the value of AzureWebJobsStorage in local.settings.json from the previous step. Please note that using a live storage account for development purposes may incur unwanted costs, as well as unpredictable behaviour when you run varying versions of your functions.

b. Using Azurite

Azurite may be run via the VS Code extension or the command line. I recommend the latter, and I recommend running the following command from the root of your project. That way you will easily be able to delete the generated storage files if you need to "reset".

azurite --blobHost

Usage

dotnet restore
dotnet build
func start

Once the project is running you can start triggering its functions via its HTTP triggers. Use cURL, a browser, Postman, whichever. All current HTTP triggers respond to both GET and POST.

For example, to start polling the server at 46.4.59.55:5123, run your functions with func start, then:

curl http://localhost:7071/api/poll/46.4.59.55/5123

You should receive a response which includes statusQueryGetUri. This address is used to fetch the polling orchestration's current status once it has been triggered.

Docs

nwn-server-status-functions's People

Contributors

sindrekjr avatar

Watchers

 avatar

Forkers

akshatedureka

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.