When I run the request on my local version of the application using the code below, it successfully executes on the server.
$.ajax({
type: 'POST',
url: "{{=URL('default', 'serverFunction.json')}}",
data: {id: id}
});
However, when I make the request without adding '.json' after serverFunction like this:
$.ajax({
type: 'POST',
url: "{{=URL('default', 'serverFunction')}}",
data: {id: id}
});
The server code still runs but results in a 404 error.
Interestingly, on the online version, both cases lead to a 404 error despite the server code being executed.