ChrisThornham
Help: Preflight OPTIONS Requests In SolidStart. I'm Lost!
Yes, I agree that adding an OPTIONS handler is the best solution.
Just to clarify, you're saying that I should check the route inside the middleware before executing the if statement on the request?
18 replies
Help: Preflight OPTIONS Requests In SolidStart. I'm Lost!
That would definitely be REALLY helpful.
I can’t get any of my POST requests working.
I find the middleware docs to be pretty sparse. Can you point to any examples or references that I could use to set up OPTIONS requests in middleware?
18 replies
Help: Preflight OPTIONS Requests In SolidStart. I'm Lost!
Ok.. I've kept digging.
I'm using Netlify to host the backend and using a mobile client to call the API.
This works:
The POST request returns a "Success!" message. But when I send and OPTIONS request to this endpoint, I get a HTML page returned and a 200 status. I should be getting a 204.
So it appears I don't know how to handle OPTIONS requests in SolidStart.
What am I missing? How do I handle preflight OPTIONS requests in SolidStart?
18 replies
Help Configuring SolidStart with Capacitor JS
I think I figured this out.
It appears that you can't use
"use server"
with Capacitor. This means any server actions will need to be rewritten into API endpoints.
So, if you're like me and built your app with SSR and heavy use of "use server"
, you'll have a lot of code to rewrite. 🤦♂️6 replies
SRR And Web Crawlers. Help Me Understand
Sweet! Thank you.
I agree. The "get indexed" timeline is extremely variable. I've been an online entrepreneur for 15+ years now, and I still don't fully understand how Google's algorithm works. Haha.
Have a good one.
5 replies
SRR And Web Crawlers. Help Me Understand
Haha. Chicken or egg. It's hard to build a sitemap without a crawler.
I just coded a custom sitemap generator using import.meta.glob from vite.
Do you think it will work if I add that sitemap to my site and a robots.txt file?
5 replies
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
I think you'll have to recall your getUser function on each load. Or store the current user name. Then check it on page load. If the user name is the same, proceed. But if the user name has changed, rerun getUser.
10 replies
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
Couldn't you use
onMount()
or createEffect()
on the page you are redirecting to?
Basically, when this page loads, check for a websocket connection. If it exists, return. If not, reconnect.10 replies