Skip to content

Commit

Permalink
fix: replace middleware with next.config.js redirects to get redirect…
Browse files Browse the repository at this point in the history
…s working
  • Loading branch information
ewan-escience committed Jan 14, 2025
1 parent bcbb634 commit a6cad4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
21 changes: 0 additions & 21 deletions frontend/middleware.ts

This file was deleted.

22 changes: 20 additions & 2 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2021 - 2023 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2021 - 2023 dv4all
// SPDX-FileCopyrightText: 2022 - 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]>
// SPDX-FileCopyrightText: 2022 - 2024 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 - 2025 Ewan Cahen (Netherlands eScience Center) <[email protected]>
// SPDX-FileCopyrightText: 2022 - 2025 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 Jesús García Gonzalez (Netherlands eScience Center) <[email protected]>
// SPDX-FileCopyrightText: 2023 - 2024 Dusan Mijatovic (Netherlands eScience Center)
//
Expand Down Expand Up @@ -47,4 +47,22 @@ module.exports = {
})
return config
},

// default redirects
async redirects() {
return [
// community default page
{
source: '/communities/:slug',
destination: '/communities/:slug/software',
permanent: true,
},
// profile default page
{
source: '/profile/:orcid',
destination: '/profile/:orcid/software',
permanent: true,
},
]
},
}

0 comments on commit a6cad4b

Please sign in to comment.