Hello Guys, Question I would to change the base ro...
# support
z
Hello Guys, Question I would to change the base route for the api , for example change /api/orders/current to /api/v1/orders/current (Add v1) the reason for doing this is because we have other custom endpoints and we want to keep the same url for consistency
j
If you're looking to change all the paths for the API, you'll probably break parts of the admin that use the API if you do that.
z
ohh I see, makes sense
j
You'll likely have a better time just building your own
v2
namespace, or whatever you need.
z
so basically I can make the same controller to point to current route and create a new namespace to point the same controller to v2 right ? 🤔
j
I'm not entirely sure what you mean, but my recommendation is to create new API controllers for new functionality you need.
z
no I meant /api/orders/current works great as it is but since I have /api/orders/v1/yesterday , i would like to have /api/orders/ as /api/v1/orders/ without breaking the admin 🙂 , so kinda having 2 routes pointing to the same controller
api/orders/current and /api/orders/v1/current should be the same
j
oh, you should just be able to make a new route that routed to the old controller
✅ 1
z
yep I did that ty