Redwood's api functions don't really support routing - which is understandable as GraphQL is our primary endpoint to receieve/send data.
However there are certain cases that would benefit from supporting "routing" on the api side too
e.g. Receiving oauth callbacks
myredwoodapp.com/api/oauth/github/callback
myredwoodapp.com/api/oauth/twitter/callback
Here oauth is the actual function that takes parameters "github", "twitter" and "callback"
ℹ️ Note:
This is possible using redirect settings on Netlify/Vercel/Render - but there isn't a built-in way to achieve this
Originally from @viperfx
With the redwood app I am working on, we integrate with different services. We are working on a Slack app, Intercom app, Zapier App etc.
We use the serverless functions to the do following functionality:
Oauth redirect and callback URLs
Incoming webhook support to integrate with platforms
APIs we create according to the platform spec.
So the project right now sits at close to 20 functions, and we are not yet done with the integrations we want to develop.
For code organization, I have used the following naming scheme, to make things a bit more manageable.
[platform]-[function].js
e.g. intercom-oauth-callback.js, slack-auth.js
Another use case is the use of libraries such as quirrel.dev - which will greatly benefit from folder support. As each "queue" is a serverless function.
Redwood's api functions don't really support routing - which is understandable as GraphQL is our primary endpoint to receieve/send data.
However there are certain cases that would benefit from supporting "routing" on the api side too
e.g. Receiving oauth callbacks
/oauth/github/callback
/oauth/twitter/callback
Here
oauth
is the actual function that takes parameters "github", "twitter" and "callback"ℹ️ Note: This is possible using redirect settings on Netlify/Vercel/Render - but there isn't a built-in way to achieve this
Originally from @viperfx