Tango Web API

An API to bundle Webservers and Webinterfaces for your Mods

Редакция NLZONE · 1 мин чтения · 0 просмотров
Tango Web API
Скачать Tango Web API1.21.10 – 1.21.8 · с официальной страницы: modrinth.com
Перейти к загрузке

Что это

An API to bundle Webservers and Webinterfaces for your Mods

  • Тип: мод
  • Загрузчик: fabric, neoforge
  • Версии Minecraft: 1.21.10 – 1.21.8
  • Скачиваний на Modrinth: 754

Подробно

A single shared webserver mod for Fabric/NeoForge that removes boilerplate for other mods. TangoWebAPI provides one embedded HTTP server that mods can use to expose their own endpoints or static assets.

Features - Shared HTTP server (Java HTTP) for all mods, start/stop in common code. - Simple API for routes: get/post/registerRoute with mod namespace (/modid/...). - Static file serving per mod (serveStatic with safe path handling). - Built-in health/info/route listing: /tango-webapi/health, /tango-webapi/info, /tango-webapi/routes. - Configuration via file (config/tango-webapi.properties) or env/system props. - Error pages (404/405/503) with simple HTML templates.

Configuration File: config/tango-webapi.properties properties host=0.0.0.0 port=8080 maxRequestBytes=1000000

Or via env/system properties: - TANGOWEBAPIHOST / tango.webapi.host - TANGOWEBAPIPORT / tango.webapi.port - TANGOWEBAPIMAXBYTES / tango.webapi.maxbytes

API for other mods (examples) java // Simple text route at /mymod/ping TangoWebAPI.get("mymod", "/ping", ctx -> ctx.sendText(200, "pong"));

// JSON response TangoWebAPI.post("mymod", "/data", ctx -> ctx.sendJson(200, "{\"ok\":true}"));

// Static assets from config/mymod/static under /mymod/static/ TangoWebAPI.serveStatic("mymod", "static", Path.of("config", "mymod", "static"));

Built-in endpoints - GET /tango-webapi/health – status - GET /tango-webapi/info – host/port/max-bytes - GET /tango-webapi/routes – all registered routes incl. prefix routes

Testing - After game start: http://localhost:8080/tango-webapi/health / info / routes - Register your own route and hit it via browser/curl. - Serve a static page under your mod path and verify it loads.

Как установить

Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.

Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.

Редакция NLZONE

Пишем о серверах, модах и играх, в которые играем сами. Нашли ошибку — напишите нам, исправим.

Комментарии 0

Комментарии к этому материалу отключены.

Читайте также