mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
implemented fetching of minecraft server status
This commit is contained in:
21
src/widgets/minecraft/widget.js
Normal file
21
src/widgets/minecraft/widget.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
import { asJson } from "utils/proxy/api-helpers";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/{endpoint}/{domain}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
mappings: {
|
||||
status: {
|
||||
endpoint: "2",
|
||||
map: (data) => {
|
||||
const jsonData = asJson(data);
|
||||
return {
|
||||
players: jsonData.players,
|
||||
version: jsonData.version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default widget;
|
||||
Reference in New Issue
Block a user