Web-API
Web-API is a RESTful API to access & manage your Sponge Minecraft server.
Default server runs on localhost port 8080. There is a Redoc documentation available at that address.
Features
Provides endpoints with:
- General information about the server
- Chat history
- Arbitrary command execution (like using the server console)
- A list of all the worlds & detailed information about them
- A list of all online players & detailed information about them
- A list of all the plugins and detailed information about them
Docs / Source
Can be found on Github
Downloads
Are available here
Issues
Please report them here
2 Likes
A couple of notes on your file handling:
- In your main class, calling
toFile
on Path
s defeats the purpose of Path
s in the first place; Files.exists
is the way one works with Path
s.
- It also defeats the purpose of the
assets/pluginid
naming convention to call getResource
; it’s meant to be used with the Asset API (e.g. game.getAssetManager().getAsset(this, "defaults/configName").get().copyToFile(configPath.resolve(configName)
)
Thanks for the tips, already used the File.exists method.
I also see what you mean with the getResource
, but the problem is that if I just copy the defaults file I cannot use the mergeValuesFrom
method, and would have to provide default values in the getters [config.getNode(...).getString(<default>)
] which means I would have default values in two places (the default file and the getters)
Is there any better way to solve this?
You can use getURL()
method instead.
@pie_flavor thanks
I also simplified the permissions and added an IP white- and blacklist.