forked from Mirrors/swingmusic-webclient
fix: logtrack worker url formation
This commit is contained in:
@@ -2,7 +2,8 @@ onmessage = (e) => {
|
||||
const { trackhash, duration, source, timestamp } = e.data;
|
||||
|
||||
const is_dev = location.port === "5173";
|
||||
const base_url = is_dev ? "http://localhost:1980" : location.origin;
|
||||
const protocol = location.protocol.replace(':', '');
|
||||
const base_url = is_dev ? `${protocol}://${location.hostname}:1980` : location.origin;
|
||||
const url = base_url + "/logger/track/log";
|
||||
|
||||
fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user