Skip to content
Discussion options

You must be logged in to vote

The official Request interface only provides request.url as a string.

https://developer.mozilla.org/en-US/docs/Web/API/Request/url

However, you can access the URL interface from the arguments instead such as

/** @type {import('./$types').RequestHandler} */
- export async function GET( { request, response }) {
+ export async function GET( { url }) {
-     console.log(request.url.searchParams.get('video_key') )
+     console.log(url.searchParams.get('video_key') )
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by magic-thomas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants