mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-22 17:03:50 +01:00
8 lines
334 B
TypeScript
8 lines
334 B
TypeScript
export default defineNuxtRouteMiddleware((to, from) => {
|
|
if (process.client && to.path !== '/' && !to.path.endsWith('/') && !to.path.includes(".")) {
|
|
const { path, query, hash } = to
|
|
const nextPath = path + '/' || '/'
|
|
const nextRoute = { path: nextPath, query, hash }
|
|
return navigateTo(nextRoute, { redirectCode: 301 })
|
|
}
|
|
}) |