mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
17 lines
432 B
JavaScript
17 lines
432 B
JavaScript
import { getNetlifyRedirect } from '~/helpers/config.js'
|
|
|
|
export async function catchRedirectResponse ( Astro ) {
|
|
const requestUrl = new URL( Astro.request.url )
|
|
|
|
const netlifyRedirectUrl = await getNetlifyRedirect( requestUrl.pathname )
|
|
|
|
// console.log('netlifyRedirectUrl', netlifyRedirectUrl)
|
|
|
|
if ( netlifyRedirectUrl !== null ) {
|
|
return Astro.redirect( netlifyRedirectUrl.to )
|
|
}
|
|
|
|
return null
|
|
}
|
|
|
|
|