How to setup API endpoint at different root than /api #13816
Replies: 3 comments
-
Currently that is not possible with Next's built-in API routes. The API routes always live at Some options would be to set this redirect up at the server level with your proxy (i.e. nginx or apache or whatever you use). Otherwise a custom server could help in this scenario but it is strongly discouraged because it will "remove important performance optimizations, like serverless functions and Automatic Static Optimization." |
Beta Was this translation helpful? Give feedback.
-
Have you tried |
Beta Was this translation helpful? Give feedback.
-
Stripe allows you to use arbitrary webhook URLs. So you can point it to for example https://mydomain.com/api/stripe/webhook. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Title says it all,
Basically I need to setup webhooks from Stripe, which POST at mydomain.com/webhook
How can I create an API route that's not under /api/webhook but under /webhook
Hope that made sense,
Peace
Beta Was this translation helpful? Give feedback.
All reactions