Replies: 1 comment 3 replies
-
That'll be nice to have, but why have this if the remote functions are meant to be used as functions in your template? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In a discussion on Discord the other day, I had an idea for remote function endpoints that would supplement existing remote function features. In addition to the
something.remote.ts
files that you can use in$lib/
orsrc/routes/
already, the idea would be the ability to create+remote.ts
files insrc/routes/
that generate actual endpoints.So for example:
Results in endpoints like
For input, the URL parameters or POST body would be validated against the validation library.
So
?name=John&role=user
, would be validated against something like:And of course, you could still use the functions from this file like any other remote function. The only other difference would be that these functions do have a route id.
Beta Was this translation helpful? Give feedback.
All reactions