FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
scroll-documentation/src/middleware.ts at develop · scroll-tech/scroll-documentation · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
scroll-tech
/
scroll-documentation
Public
Notifications
You must be signed in to change notification settings
Fork
196
Star
699
Code
Issues
38
Pull requests
49
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
scroll-documentation
/
src
/
middleware.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (33 loc) · 1001 Bytes
Breadcrumbs
scroll-documentation
/
src
/
middleware.ts
Copy path
File metadata and controls
38 lines (33 loc) · 1001 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import
type
{
MiddlewareHandler
}
from
"astro"
export
const
onRequest
:
MiddlewareHandler
=
(
context
,
next
)
=>
{
const
url
=
new
URL
(
context
.
request
.
url
)
const
pathname
=
url
.
pathname
if
(
pathname
.
startsWith
(
"/sdk"
)
||
pathname
.
startsWith
(
"/en/sdk"
)
||
pathname
.
startsWith
(
"/es/sdk"
)
||
pathname
.
startsWith
(
"/tr/sdk"
)
||
pathname
.
startsWith
(
"/zh/sdk"
)
)
{
return
context
.
redirect
(
"/developers"
,
301
)
}
if
(
pathname
.
startsWith
(
"/learn"
)
||
pathname
.
startsWith
(
"/en/learn"
)
||
pathname
.
startsWith
(
"/es/learn"
)
||
pathname
.
startsWith
(
"/tr/learn"
)
||
pathname
.
startsWith
(
"/zh/learn"
)
)
{
return
context
.
redirect
(
"/technology"
,
301
)
}
if
(
pathname
.
startsWith
(
"/user-guide"
)
||
pathname
.
startsWith
(
"/en/user-guide"
)
||
pathname
.
startsWith
(
"/es/user-guide"
)
||
pathname
.
startsWith
(
"/tr/user-guide"
)
||
pathname
.
startsWith
(
"/zh/user-guide"
)
)
{
return
context
.
redirect
(
"/community"
,
301
)
}
return
next
(
)
}
Back
|
FazBrowse Home
|
New Git URL