rouckay wrote a reply+100 XP
4mos ago
I have the same issue I can't able to write the logic for my app from scratch is there any way to generate the API from existance controller?
rouckay liked a comment+100 XP
4mos ago
I think ideally you'll want dedicated api routes that use similar functionality. What that might look like in practice would be stripping logic out of your controllers into reusable traits so that your controller methods simply call the appropriate trait method to get data, and the controller responds either with a view template for your existing routes or with json for new api routes.
As for authentication, you'll likely want to use something like JWT