Fix: Use relative URL for API requests in admin UI
Changed the request URL in from an absolute path () to a relative path (). This ensures that the API request is always sent to the same domain that the admin page is loaded from, resolving CORS and NetworkError issues when accessing the UI from a production FQDN or a live server with a different port. This change relies on a correctly configured reverse proxy in the production environment.
This commit is contained in:
parent
b8c8a1a45f
commit
91885d5ff5
2
admin.js
2
admin.js
@ -77,7 +77,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
fetch('http://localhost:3050/api/update-status', {
|
fetch('/api/update-status', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user