tchiotludo / akhq

Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
https://akhq.io/
Apache License 2.0
3.4k stars 657 forks source link

Running locally in intellij does not find .css and .js files and shows 404 #103

Closed HungUnicorn closed 5 years ago

HungUnicorn commented 5 years ago

I start the application locally in intellij, from App.java, and set -Dmicronaut.config.files=PATH_TO_APPLICATION_YML. The endpoint is accessible and show some data from my kafka cluster, but the output is the same as this issue described https://github.com/tchiotludo/kafkahq/issues/16

The log shows css and js files are not loaded. Perhaps I miss some setup?

2019-08-13 16:17:32,292 INFO  main       i.m.runtime.Micronaut      Startup completed in 3338ms. Server Running: http://localhost:8080
2019-08-13 16:17:47,728 INFO  pGroup-1-2 org.kafkahq.log.access     [Date: 2019-08-13T16:17:38.618412+02:00] [Duration: 9104 ms] [Url: GET /svc-kafka-pre/topic HTTP/1.1] [Status: 200] [Ip: 0:0:0:0:0:0:0:1] [Length: 2599] [Port: 8080]
2019-08-13 16:17:48,121 WARN  pGroup-1-2 org.kafkahq.log.access     [Date: 2019-08-13T16:17:47.77299+02:00] [Duration: 347 ms] [Url: GET /static/css/vendor.css HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 419] [Port: 8080]
2019-08-13 16:17:48,121 WARN  pGroup-1-6 org.kafkahq.log.access     [Date: 2019-08-13T16:17:47.873302+02:00] [Duration: 247 ms] [Url: GET /static/img/logo.svg HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 417] [Port: 8080]
2019-08-13 16:17:48,121 WARN  pGroup-1-4 org.kafkahq.log.access     [Date: 2019-08-13T16:17:47.833553+02:00] [Duration: 287 ms] [Url: GET /static/js/vendor.js HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 417] [Port: 8080]
2019-08-13 16:17:48,121 WARN  pGroup-1-3 org.kafkahq.log.access     [Date: 2019-08-13T16:17:47.805147+02:00] [Duration: 316 ms] [Url: GET /static/css/main.css HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 417] [Port: 8080]
2019-08-13 16:17:48,121 WARN  pGroup-1-5 org.kafkahq.log.access     [Date: 2019-08-13T16:17:47.833553+02:00] [Duration: 287 ms] [Url: GET /static/js/main.js HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 415] [Port: 8080]
2019-08-13 16:18:12,118 WARN  pGroup-1-8 org.kafkahq.log.access     [Date: 2019-08-13T16:18:12.111118+02:00] [Duration: 6 ms] [Url: GET /static/css/main.css HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 417] [Port: 8080]
2019-08-13 16:18:12,123 WARN  pGroup-1-7 org.kafkahq.log.access     [Date: 2019-08-13T16:18:12.11226+02:00] [Duration: 11 ms] [Url: GET /static/css/vendor.css HTTP/1.1] [Status: 404] [Ip: 0:0:0:0:0:0:0:1] [Length: 419] [Port: 8080]
tchiotludo commented 5 years ago

To be honest, I mostly develop the app using docker with dev env. This enabled hot reload for css / js and backend auto restart with micronaut.

When I need to dev with intellijidea, I used to manually call webpack on root folder on kafkahq that will build css & js.

I've not included it in gradle run to avoid compilaton time for backend since backend need more work than frontend.

HungUnicorn commented 5 years ago

should I run the following?

npm install webpack --save-dev
npx webpack --config webpack.config.js
tchiotludo commented 5 years ago

Yep. Or simply use the docker-compose-dev that will Spawn a full dev env with micronaut + webpack like I do