Hoping someone can help me figure out what’s going on here. I have an /api folder in a directory spitting out the children’s attributes, on server 1 I get the JSON when visiting domain.com/locations/api
However, on server 2 I get a rendered page. The content directory is identical. Wondering if it could be a php settings issue?
Can it be that it falls back to the default template for some reason? Or what does it render? Are you using content representations or is there just a single API template that is supposed to render the JSON?
Thanks @texnixe, yes it is falling back to the default template—just a blank page with a title.
Just figured it out: there were two files in the /api folder (I guess I had the sample file from the demo here: https://getkirby.com/docs/cookbook/json) in addition to my own file that corresponded with the template name:
locations/
api/
blogapi.txt
locationsapi.txt
Once I deleted the additional file, it started spitting out my JSON by using the correct template. I’m assuming that since blogapi.txt is first, it looked for the template blogapi.php and couldn’t find it, so went to default.php. Funny it isn’t happening on the other server.