what's the best way to build the following with Astro SSR.
A small app with a input box on the UI. All i need is the query ( user input) to pass to the backend.
Make the network request on the server given the query and send the fully generated HTML to the client.
I've tried the Astro.url.searchParams to get the query from the UI but i had to do location.reload() for it to work.
SERVER index.astro
const searchQuery: string = Astro.url.searchParams.get("q") ?? "";
const query: string = searchQuery.toLowerCase();
result = await getRecipeInfo(query);
CLIENT somefile.ts
const searchQuery = inputBox.value.trim();
const formattedQuery = searchQuery.replace(/\s+/g, "+");
const newURL = ${window.location.origin}/?q=${formattedQuery};
window.history.pushState({ q: formattedQuery }, "", newURL);
location.reload();