You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
776 B
37 lines
776 B
1 year ago
|
import { html } from 'lit'
|
||
|
import { Router } from '@thepassle/app-tools/router.js'
|
||
|
|
||
|
// views
|
||
|
import '../components/MapView.js'
|
||
|
import '../components/NewMapModal.js'
|
||
|
|
||
|
if (!globalThis.URLPattern) {
|
||
|
await import('urlpattern-polyfill')
|
||
|
}
|
||
|
|
||
|
// router
|
||
|
export default new Router({
|
||
|
fallback: '/404',
|
||
|
routes: [
|
||
|
{
|
||
|
path: '/',
|
||
|
title: 'ethermap | index',
|
||
|
render: () => html`
|
||
|
<map-view></map-view>
|
||
|
<newmap-modal></newmap-modal>
|
||
|
`
|
||
|
},
|
||
|
{
|
||
|
path: '/m/:mapId',
|
||
|
title: ({ params }) => `ethermap | ${params.mapId}`,
|
||
|
render: ({ params }) => html`<map-view name=${params.mapId}></map-view>`
|
||
|
},
|
||
|
{
|
||
|
path: '/404',
|
||
|
title: 'etherpad | 404',
|
||
|
render: () => html`<h2>404 : page not found</h2>`
|
||
|
}
|
||
|
]
|
||
|
})
|
||
|
|