mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Initial commit
This commit is contained in:
commit
d1b8e8f676
26 changed files with 3283 additions and 0 deletions
25
middleware.ts
Normal file
25
middleware.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { NextRequest, NextResponse } from 'next/server'
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
'/ip',
|
||||
'/s3',
|
||||
'/r2',
|
||||
'/spotify'
|
||||
]
|
||||
};
|
||||
|
||||
export default async function middleware(request: NextRequest) {
|
||||
switch (request.nextUrl.pathname) {
|
||||
case '/ip':
|
||||
return NextResponse.rewrite(new URL('/api/ip', request.nextUrl.origin))
|
||||
case '/s3':
|
||||
return NextResponse.rewrite(new URL('/api/s3', request.nextUrl.origin))
|
||||
case '/r2':
|
||||
return NextResponse.rewrite(new URL('/api/s3', request.nextUrl.origin))
|
||||
case '/spotify':
|
||||
return NextResponse.rewrite(new URL('/api/spotify', request.nextUrl.origin))
|
||||
default:
|
||||
return NextResponse.next()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue