itzg / mc-router

Routes Minecraft client connections to backend servers based upon the requested server address

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Persistent routes

LasseR15 opened this issue · comments

Hi,

I'm tinkering a bit with the REST API right now and really like this project.
Is it possible to persist the routes added or changed via the API so that they are preserved even after a restart?

Not yet but that would be a great enhancement.

If you're interested in doing that, I would suggest persisting to a JSON file that is named from a user argument. That way the feature can serve double duty as a way to pre-load the routes from a file.

Do you mean an argument at startup like the argument for API bindings (-api-binding)? So for example -routes-config (env: ROUTES_CONFIG) for the path to the configuration file (or just the name)?

Yes, that's what I was thinking. And a path seems more versatile. That way it can also be just a filename relative to working directory.

Alright, I'll look into it this weekend and open a pull request as soon as I'm ready.

Implemented by #145