1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-09-12 14:51:09 +02:00

Attempt to use react router the way it was meant to

This commit is contained in:
Philipp Heckel 2022-03-08 14:13:32 -05:00
parent 4aad98256a
commit 55c021796e
3 changed files with 63 additions and 57 deletions

View file

@ -10,6 +10,7 @@ export const topicUrlJsonPollWithSince = (baseUrl, topic, since) => `${topicUrlJ
export const topicUrlAuth = (baseUrl, topic) => `${topicUrl(baseUrl, topic)}/auth`;
export const topicShortUrl = (baseUrl, topic) => shortUrl(topicUrl(baseUrl, topic));
export const shortUrl = (url) => url.replaceAll(/https?:\/\//g, "");
export const expandUrl = (url) => [`https://${url}`, `http://${url}`];
export const validUrl = (url) => {
return url.match(/^https?:\/\//);