traxxx-web/pages/actors/+route.js

21 lines
437 B
JavaScript
Raw Normal View History

2024-01-04 00:49:16 +00:00
import { match } from 'path-to-regexp';
// import { resolveRoute } from 'vike/routing'; // eslint-disable-line import/extensions
const path = '/actors/:page?';
const urlMatch = match(path, { decode: decodeURIComponent });
export default (pageContext) => {
const matched = urlMatch(pageContext.urlPathname);
if (matched) {
return {
routeParams: {
page: matched.params.page || '1',
path,
},
};
}
return false;
};