mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Enable overriding the API port number
Using an environment variable called BISQ_API_PORT, it is now possible to override the default API port of 8080 to whichever available port desired. This enables running the API on a machine where port 8080 is occupied, it also enables running multiple Bisq instances side-by-side with their respective API's enabled. Signed-off-by: Mike Rosseel <mike.rosseel@gmail.com>
This commit is contained in:
parent
a72986ff5b
commit
290d7237f4
3 changed files with 38 additions and 4 deletions
|
@ -1,5 +1,12 @@
|
|||
current api docs are at:
|
||||
https://github.com/dan-da/bitsquare/blob/rpc_api/doc/api/README.md
|
||||
# Bisq API
|
||||
|
||||
*Based on proposal XX*
|
||||
|
||||
## Enabling the api
|
||||
|
||||
--enableApi true
|
||||
|
||||
## Exploring the REST API
|
||||
|
||||
generated swagger docs are at:
|
||||
http://localhost:8080/swagger
|
||||
|
@ -7,5 +14,14 @@ http://localhost:8080/swagger
|
|||
swagger.json can be found at (generate clients with swagger editor):
|
||||
http://localhost:8080/swagger.json
|
||||
|
||||
the admin interface can be found at:
|
||||
http://localhost:8080/admin[
|
||||
|
||||
## Overriding http port
|
||||
|
||||
Set an environment variable called "BISQ_API_PORT" to your desired port.
|
||||
|
||||
## TODO
|
||||
|
||||
Candidate for hosting the docs:
|
||||
https://github.com/Rebilly/ReDoc
|
|
@ -17,7 +17,9 @@ import io.bisq.core.user.Preferences;
|
|||
import io.bisq.core.user.User;
|
||||
import io.bisq.network.p2p.P2PService;
|
||||
import io.dropwizard.Application;
|
||||
import io.dropwizard.configuration.EnvironmentVariableSubstitutor;
|
||||
import io.dropwizard.configuration.ResourceConfigurationSourceProvider;
|
||||
import io.dropwizard.configuration.SubstitutingSourceProvider;
|
||||
import io.dropwizard.setup.Bootstrap;
|
||||
import io.dropwizard.setup.Environment;
|
||||
import io.federecio.dropwizard.swagger.SwaggerBundle;
|
||||
|
@ -81,6 +83,13 @@ public class DropwizardApplication extends Application<ApiConfiguration> {
|
|||
return configuration.swaggerBundleConfiguration;
|
||||
}
|
||||
});
|
||||
// Overriding settings through environment variables, added to override the http port from 8080 to something else
|
||||
// See http://www.dropwizard.io/1.1.4/docs/manual/core.html#configuration
|
||||
bootstrap.setConfigurationSourceProvider(
|
||||
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
|
||||
new EnvironmentVariableSubstitutor(false)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,3 +4,12 @@ defaultName: Stranger
|
|||
# the only required property is resourcePackage, for more config options see below
|
||||
swagger:
|
||||
resourcePackage: io.bisq.api.service
|
||||
|
||||
|
||||
server:
|
||||
type: simple
|
||||
applicationContextPath: /
|
||||
adminContextPath: /admin
|
||||
connector:
|
||||
type: http
|
||||
port: ${BISQ_API_PORT:-8080}
|
Loading…
Add table
Reference in a new issue