almost 4 years ago
1.) The file extension doesn't really matter (I suggest to use json though if you have a static file). It is more important to set the right mime-type in the response header (Content-Type: application/json). This way, your frontend will be notified that the data that is passed is actually JSON data.