2020-12-01 16:41:27 +00:00
|
|
|
import { html } from "lit-html";
|
|
|
|
import { Route, SLUG_REGEX } from "./pages/router/Route";
|
|
|
|
|
2020-12-02 14:44:40 +00:00
|
|
|
import "./pages/LibraryPage";
|
|
|
|
import "./pages/admin-overview/AdminOverviewPage";
|
|
|
|
import "./pages/applications/ApplicationListPage";
|
|
|
|
import "./pages/applications/ApplicationViewPage";
|
|
|
|
|
2020-12-01 16:41:27 +00:00
|
|
|
export const ROUTES: Route[] = [
|
|
|
|
// Prevent infinite Shell loops
|
|
|
|
new Route(new RegExp("^/$")).redirect("/library/"),
|
|
|
|
new Route(new RegExp("^#.*")).redirect("/library/"),
|
2020-12-05 21:08:42 +00:00
|
|
|
new Route(new RegExp("^/library/$"), html`<ak-library></ak-library>`),
|
|
|
|
new Route(new RegExp("^/administration/overview-ng/$"), html`<ak-admin-overview></ak-admin-overview>`),
|
|
|
|
new Route(new RegExp("^/applications/$"), html`<ak-application-list></ak-application-list>`),
|
2020-12-01 16:41:27 +00:00
|
|
|
new Route(new RegExp(`^/applications/(?<slug>${SLUG_REGEX})/$`)).then((args) => {
|
2020-12-05 21:08:42 +00:00
|
|
|
return html`<ak-application-view .args=${args}></ak-application-view>`;
|
2020-12-01 16:41:27 +00:00
|
|
|
}),
|
|
|
|
];
|