-
Hi! I've been trying to put together an app which mainly renders HTML server side with SSR, with axum in an AWS lambda. I understand though that all server fns get exposed as API endpoints - which also has the downside of extending the potential security attack surface of my application and requiring extra work to authenticate or protect in some other way. Is this possible in any way? Perhaps not with the Many thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Maybe I'm confused but a server function that can't be called from the client is just a function. Is the question "How do I mark a function so it's not compiled for the browser because it has dependencies that can't be compiled to WASM?" |
Beta Was this translation helpful? Give feedback.
That looks pretty straightforward to me. It's pretty rare that you want the data simply not to be accessible if you are navigating from another page, but if that's what you want, that's what you want!
i.e., taking a glance at this application, you are using server-side rendering and client-side hydration including the router. When you only have one page it doesn't matter because this one page is the only starting point. If you add another page like
/foo
, then if you load/foo
and then click a link in the browser to/
, it will give you theNone
version of the data even though it does exist on the server, because subsequent page navigations are rendered in the browser.If that's what you wa…