2022-03-10 04:28:55 +00:00
|
|
|
import config from "../app/config";
|
|
|
|
import {shortUrl} from "../app/utils";
|
|
|
|
|
|
|
|
const routes = {
|
|
|
|
root: config.appRoot,
|
|
|
|
settings: "/settings",
|
|
|
|
subscription: "/:topic",
|
|
|
|
subscriptionExternal: "/:baseUrl/:topic",
|
|
|
|
forSubscription: (subscription) => {
|
|
|
|
if (subscription.baseUrl !== window.location.origin) {
|
|
|
|
return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`;
|
|
|
|
}
|
|
|
|
return `/${subscription.topic}`;
|
|
|
|
}
|
|
|
|
};
|
2022-04-08 14:44:35 +00:00
|
|
|
|
2022-03-10 04:28:55 +00:00
|
|
|
export default routes;
|