2022-03-10 05:28:55 +01:00
|
|
|
import config from "../app/config";
|
|
|
|
import {shortUrl} from "../app/utils";
|
|
|
|
|
2022-12-21 19:19:07 +01:00
|
|
|
// Remember to also update the "disallowedTopics" list!
|
|
|
|
|
2022-03-10 05:28:55 +01:00
|
|
|
const routes = {
|
2022-12-02 21:37:48 +01:00
|
|
|
home: "/",
|
2022-12-13 21:19:40 +01:00
|
|
|
pricing: "/pricing",
|
2022-12-02 21:37:48 +01:00
|
|
|
login: "/login",
|
2022-12-08 02:44:20 +01:00
|
|
|
signup: "/signup",
|
2022-12-16 04:07:04 +01:00
|
|
|
resetPassword: "/reset-password",
|
2023-01-05 04:47:12 +01:00
|
|
|
app: config.app_root,
|
2022-12-16 04:07:04 +01:00
|
|
|
account: "/account",
|
2022-03-10 05:28:55 +01:00
|
|
|
settings: "/settings",
|
|
|
|
subscription: "/:topic",
|
|
|
|
subscriptionExternal: "/:baseUrl/:topic",
|
|
|
|
forSubscription: (subscription) => {
|
2023-01-05 04:47:12 +01:00
|
|
|
if (subscription.baseUrl !== config.base_url) {
|
2022-03-10 05:28:55 +01:00
|
|
|
return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`;
|
|
|
|
}
|
|
|
|
return `/${subscription.topic}`;
|
|
|
|
}
|
|
|
|
};
|
2022-04-08 16:44:35 +02:00
|
|
|
|
2022-03-10 05:28:55 +01:00
|
|
|
export default routes;
|