What if scripts added in public folder could be exposed as API's?
If I create a file called api.news.js the system will automatically handle that because it has the api. in the filename. After saving this file I have a new endpoint on my site reachable from:
I could then post stuff to that address and get the contents using...
let jsonBody = json_decode("wix://input");
That code would get all posted into a JSON decoded string and then I can insert that into collections, work with it in anyway using WIX code and return what ever I need to return.
This way I can expose how many API's I wan't by just adding files, I don't have to expose my whole Data Collections or in anyway do anything else.
Add a file in a certain naming convention and then rock n roll.