Split stuff
This commit is contained in:
parent
31e7aa24bc
commit
1fe598a966
5 changed files with 76 additions and 55 deletions
6
web/src/utils.js
Normal file
6
web/src/utils.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
export const topicUrl = (baseUrl, topic) => `${baseUrl}/${topic}`;
|
||||
export const topicUrlWs = (baseUrl, topic) => `${topicUrl(baseUrl, topic)}/ws`
|
||||
.replaceAll("https://", "wss://")
|
||||
.replaceAll("http://", "ws://");
|
||||
export const shortUrl = (url) => url.replaceAll(/https?:\/\//g, "");
|
||||
export const shortTopicUrl = (baseUrl, topic) => shortUrl(topicUrl(baseUrl, topic));
|
Loading…
Add table
Add a link
Reference in a new issue