Skip to content

Azure Storage database connector for boardgame.io

License

Notifications You must be signed in to change notification settings

c-w/bgio-azure-storage

Repository files navigation

bgio-azure-storage

NPM Version CI Status Coverage Status

Azure Storage database connector for boardgame.io

This package provides a database connector that allows you to use an Azure Storage account to store boardgame.io metadata and game state.

Installation

npm install --save bgio-azure-storage

Versioning

The major and minor versions of this package follow the major and minor versions of the upstream boardgame.io package.

Usage

const { AzureStorage } = require('bgio-azure-storage');
const { BlobServiceClient } = require('@azure/storage-blob');
const { Server } = require('boardgame.io/server');
const { MyGame } = require('./game');

const database = new AzureStorage({
  client: BlobServiceClient.fromConnectionString('enter your connection string here'),
  container: 'boardgameio',
});

const server = Server({
  games: [MyGame],
  db: database,
});

server.run(8000);