Skip to content

Serverless node.js helpers not working #6897

Answered by QuiiBz
jlrodvPF asked this question in Help
Discussion options

You must be logged in to vote

The query property indeed doesn't exist on the Request object: https://developer.mozilla.org/en-US/docs/Web/API/Request

I'm assuming you want to access the query parameters of the request. You can do so by accessing the url property, constructing a new URL object and accessing the searchParams property:

export async function GET(request: Request) {
  const url = new URL(request.url)
  const query = url.searchParams
  // query is a URLSearchParams object: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by QuiiBz
Comment options

You must be logged in to vote
2 replies
@QuiiBz
Comment options

@jlrodvPF
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants