Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: GET config file(s) #189

Open
MaxPtg opened this issue Aug 26, 2023 · 2 comments
Open

API: GET config file(s) #189

MaxPtg opened this issue Aug 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@MaxPtg
Copy link

MaxPtg commented Aug 26, 2023

Is your feature request related to a problem? Please describe.

Infrared does currently have a simple REST-API but it's missing 2 core features: listing all currently active configs as well as retreiving a sample config.

Describe the solution you'd like

Implement 2 new API routes, preferably GET /proxies for retreiving all currently active proxies and GET /proxies/{fileName} for retreiving the contents of a specific config file.

Describe alternatives you've considered

I have made my way around this issue by simply reading the contents of the config directory and parsing all contents of these files into one bis JSON array. But there are wayyy more points of failure in this rather than doing this by the built-in REST API.

@MaxPtg MaxPtg added the enhancement New feature or request label Aug 26, 2023
@haveachin
Copy link
Owner

In v2 are endpoints for reading and writing configs. Try /docs or look at the swagger.yaml yourself https://github.com/haveachin/infrared/blob/rewrite/api/swagger.yaml

@MaxPtg
Copy link
Author

MaxPtg commented Aug 27, 2023

Thanks for pointing that out!

After a bit of trial an error I got the rewrite working on my system and the API does all it's supposed to.
But more documentation would be much appreciated in the future (e. g. that you need to pass the config file content as a JSON object).

I just have one more question: Can I pass the forge/fabric compatibility to the requesting client?
I have a few modded servers which all show Incompatible Vanilla server with the Better Compatibility Checker.
Passing the corresponding versionName and/or protocolNumber does not seem to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants