Skip to content

nimdanitro/handball-ch-widget

Repository files navigation

Handball Schweiz API Widget

This project allows you to view and embed last results and next games for teams and clubs using the API from Handball Schweiz

Introduction

This is a small react app, optimized to run on Cloudflare Pages. The serverless function will add the club specific auth token for API requests going to the API from Handball Schweiz. You need to set the following environment variables on the cloudflare pages project:

  • API_KEY: with the base64 encoded API key from Handball Schweiz
  • FRAME_ANCESTORS: set a space separated list of domains which should be added to the frame-ancestor CSP header

How to use

You can iframe the following URLs:

Controlling the number of results and next games

By default the last 10 and the next 10 games are displayed for both club and team. This can be changed by adding the following query parameters:

  • results: for defining the number of played games displayed
  • next: for defining the number of planned games displayed

Hence, if you want do display the last 20 results and the next 30 games of club 140675, you would use the following URL:

https://${hostname}/verein/140675?results=20&next=30

Acknowledgements

This project has been created in collaboration with the HC KTV Altdorf.