Categorygithub.com/vikpe/qw-hub-api
modulepackage
0.7.3
Repository: https://github.com/vikpe/qw-hub-api.git
Documentation: pkg.go.dev

# README

QW Hub API Test codecov Go Report Card

Web API serving QuakeWorld info

Usage

  1. Rename/edit config.sample.json to config.json.
  2. Rename/edit .env.example to .env.
  3. Build
  4. ./qw-hub-api

Config

See config.sample.json

Example

{
  "port": 3000,
  "servers": {
    "active_server_interval": 4,
    "server_interval": 30,
    "master_interval": 14400,
    "master_servers": [
      "master.quakeworld.nu:27000",
      "master.quakeservers.net:27000",
      "qwmaster.ocrana.de:27000",
      "qwmaster.fodquake.net:27000"
    ]
  },
  "qtv_demo_sources": [
    {
      "address": "de.quake.world:28000",
      "demo_date_format": "ymd",
      "timezone": "UTC"
    },
    {
      "address": "troopers.fi:28000",
      "demo_date_format": "ymd",
      "timezone": "Europe/Helsinki"
    },
    {
      "address": "quake.se:28000",
      "demo_date_format": "Ymd",
      "timezone": "Europe/Stockholm"
    }
  ],
  "streamers": {
    "annihilazor": "anni",
    "quakeworld": "[streambot]",
    "suddendeathTV": "suddendeathTV",
    "vikpe": "XantoM"
  }
}

API endpoints

URLdescription
/v2/serversAll servers
/v2/servers/mvdsvMVDSV servers
/v2/servers/qwfwdQWFWD servers (proxies)
/v2/servers/qtvQTV servers
/v2/servers/<address>Server details
/v2/servers/<address>/lastscoresServer lastscores
/v2/servers/<address>/laststatsServer laststats
/v2/masters/<address>List of servers on master
/v2/demosDemos from popular servers
/v2/streamsTwitch streams casting Quake
/v2/eventsEvents (from Wiki)
/v2/newsNews (from QuakeWorld.nu)
/v2/forum_postsForum posts (from QuakeWorld.nu Forum)

Endpoint details

MVDSV servers

/v2/servers/mvdsv

ParamTypeExampleDescription
emptyinclude|exclude|onlyempty=includeInclude empty servers (default exclude)
hostnamestringhostname=quake.seServers matching hostname quake.se
has_playerstringhas_player=xantomServers where xantom is connected as player
has_clientstringhas_client=xantomServers where xantom is connected
limitintlimit=10Limit to 10 servers

Demos

/v2/demos

ParamTypeDefaultExampleDescription
qstringq=2on2 xantom dm3Demos where filename matches 2on2, xantom and dm3
modestringmode=2on2Demos with mode 2on2
qtv_addressstringqtv_address=quake.seDemos from quake.se qtv server
limitint [1-500]100limit=10Limit to 10 demos

Build

go build

Development

Run locally.

./qw-hub-api

Now you try an endpoint, e.g. http://localhost:3000/v2/servers

Credits

  • eb
  • Tuna
  • XantoM

Related projects

# Packages

No description provided by the author