Skip to content

UI to API URL issue #14

Description

@kostyanf14

Hi @RondaYummy

Thanks for your project. It is very interesting, but I have a problem when running it in Docker.
I used docker-compose up to build and start the application. When the 2 containers started, I successfully opened http://ip:8444.
When I tried to login on the settings page, nothing happened. I checked console logs and UI accessed the wrong (from my point of view) endpoint. It sends requests to http://ip:8444/api/login instead of http://ip:8000/api/login.

I updated frontend/src/pages/SettingsPage.vue, changed await fetch('/api/login' to await fetch('http://ip:8000/api/login, rebuilt the Docker container, and tried again. This time, I logged in successfully.
The same issue happened on other pages when I tried to setup JK-BMS.

At the same time, using API from the CLI via cURL works fine.

curl 'http://ip:8000/api/login' -X POST  --data-raw '{"password":"123456"}'
curl 'http://ip:8000/api/connect-device' -X POST  -H 'Authorization: Bearer b2bfb517-15c7-446f-827d-21117b3420ce' -H "Content-Type: application/json" -d '{ "address": "a4:c1:38:06:d0:f2", "name": "test123" }'
curl 'http://ip:8000/api/device-info' -H 'Authorization: Bearer b2bfdevice-15c7-446f-827d-21117b3420ce'
curl 'http://ip:8000/api/cell-info' -H 'Authorization: Bearer b2bfb517-15c7-446f-827d-21117b3420ce'

So, this is my bug report, or a question about how to start the system in Docker to make the UI functional?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions