Add server-generated /config.js; add error boundary
This commit is contained in:
parent
04ee6b8be2
commit
840cb5b182
14 changed files with 184 additions and 85 deletions
16
web/src/components/routes.js
Normal file
16
web/src/components/routes.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
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}`;
|
||||
}
|
||||
};
|
||||
export default routes;
|
Loading…
Add table
Add a link
Reference in a new issue