Skip to content

Commit 51cf978

Browse files
author
Michael Pratt
authored
Update README.md
1 parent 987978e commit 51cf978

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

README.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,60 @@ Then open a browser and navigate to http://localhost:9000. The port can be overr
3232

3333
## Running with Docker
3434

35-
The following maven command will generate a Docker image:
35+
Note for Mac Users: You need to convert newline formatting of the kafdrop.sh file *before* running this command:
3636

3737
```
38-
mvn clean package assembly:single docker:build
38+
dos2unix src/main/docker/*
3939
```
4040

41-
Note for Mac Users: You need to convert newline formatting of the kafdrop.sh file *before* running this command:
41+
The following maven command will generate a Docker image:
4242

4343
```
44-
dos2unix src/main/docker/*
44+
mvn clean package assembly:single docker:build
4545
```
4646

47+
4748
Once the build finishes you can launch the image as follows:
4849

4950
```
5051
docker run -d -p 9000:9000 -e ZOOKEEPER_CONNECT=<host:port,host:port> kafdrop
5152
```
5253

5354
And access the UI at http://localhost:9000.
55+
56+
## Kafka APIs
57+
58+
Starting with version 2.0.0, Kafdrop offers a set of Kafka APIs that mirror the existing HTML views. Any existing endpoint can be returned as JSON by simply setting the *Accept : application/json header*. There are also two endpoints that are JSON only:
59+
60+
/topic : Returns array of all topic names
61+
/topic/{topicName}/{consumerId} : Return partition offset and lag details for a specific topic and consumer.
62+
63+
## Swagger
64+
65+
To help document the Kafka APIs, Swagger has been included. The Swagger output is available by default at the following Kafdrop URL:
66+
67+
/v2/api-docs
68+
69+
However this can be overridden with the following configuration:
70+
71+
springfox.documentation.swagger.v2.path=/new/swagger/path
72+
73+
Currently only the JSON endpoints are included in the Swagger output; the HTML views and Spring Boot debug endpoints are excluded.
74+
75+
You can disable Swagger output with the following configuration:
76+
77+
swagger.enabled=false
78+
79+
## CORS Headers
80+
81+
Starting in version 2.0.0, Kafdrop sets CORS headers for all endpoints. You can control the CORS header values with the following configurations:
82+
83+
cors.allowOrigins (default is *)
84+
cors.allowMethods (default is GET,POST,PUT,DELETE)
85+
cors.maxAge (default is 3600)
86+
cors.allowCredentials (default is true)
87+
cors.allowHeaders (default is Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization)
88+
89+
You can also disable CORS entirely with the following configuration:
90+
91+
cors.enabled=false

0 commit comments

Comments
 (0)