UNPKG
@europeana/portal
Version:
latest (1.82.0)
1.82.0
1.81.0
1.80.0
1.79.1
1.79.0
1.78.0
1.77.0
1.76.1
1.76.0
1.75.0
1.74.2
1.74.1
1.74.0
1.73.0
1.72.0
1.71.0
1.70.0
1.69.2
1.69.1
1.69.0
1.68.0
1.67.0
1.66.0
1.65.0
1.64.3
1.64.2
1.64.1
1.64.0
1.63.0
1.62.2
1.62.1
1.62.0
1.61.0
1.60.1
1.60.0
1.59.0
1.58.2
1.58.0
1.57.0
1.56.1
1.56.0
1.55.0
1.54.2
1.54.1
1.53.1-npm-publish.12
1.53.1-npm-publish.11
1.53.1-npm-publish.7
1.53.1-npm-publish.5
1.53.1-npm-publish.2
Europeana Portal
github.com/europeana/portal.js
europeana/portal.js
@europeana/portal
/
src
/
middleware
/
legacy
/
rules
/
exhibitions.js
15 lines
(12 loc)
•
309 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Redirect legacy exhibition page URLs
export
default
(route) => {
const
pattern = /^\/
portal
(\/[a-z]{
2
})?\/
exhibitions
(\/.+)$/;
const
match
= route.path.
match
(pattern);
return
match
&& (
match
[
2
] !==
'/foyer'
) ? { path: [
match
[
1
],
'/exhibitions'
,
match
[
2
] ] } : null; };