File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/main/java/me/lucko/luckperms/extension/rest Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,13 @@ public RestExtension(LuckPerms luckPerms) {
4343 @ Override
4444 public void load () {
4545 int port = RestConfig .getInteger ("http.port" , 8080 );
46+ String address = RestConfig .getString ("http.address" , "localhost" );
4647
4748 Thread thread = Thread .currentThread ();
4849 ClassLoader previousCtxClassLoader = thread .getContextClassLoader ();
4950 thread .setContextClassLoader (RestExtension .class .getClassLoader ());
5051 try {
51- this .server = new RestServer (this .luckPerms , port );
52+ this .server = new RestServer (this .luckPerms , address , port );
5253 } finally {
5354 thread .setContextClassLoader (previousCtxClassLoader );
5455 }
Original file line number Diff line number Diff line change @@ -72,19 +72,19 @@ public class RestServer implements AutoCloseable {
7272 private final Javalin app ;
7373 private final AutoCloseable routesClosable ;
7474
75- public RestServer (LuckPerms luckPerms , int port ) {
75+ public RestServer (LuckPerms luckPerms , String address , int port ) {
7676 LOGGER .info ("[REST] Starting server..." );
7777
7878 this .objectMapper = new CustomObjectMapper ();
7979
8080 this .app = Javalin .create (this ::configure )
81- .start (port );
81+ .start (address , port );
8282
8383 this .setupLogging (this .app );
8484 this .setupErrorHandlers (this .app );
8585 this .routesClosable = this .setupRoutes (this .app , luckPerms );
8686
87- LOGGER .info ("[REST] Startup complete! Listening on http://localhost:" + port );
87+ LOGGER .info (String . format ( "[REST] Startup complete! Listening on http://%s:%d" , address , port ) );
8888 }
8989
9090 @ Override
You can’t perform that action at this time.
0 commit comments