I have been trying to build an MVC structured RESTapi.Since it's going to return JSON only,is it right that my View will just have a header and that the view will output the JSON also?
I planed to implement JsonSerializable than to do some magic with it in the controller/model part, than to output it in the view.
Is it the right way?
I feel that my view is small if i would do it this way,but i red lots of articles about it and i think that it's right.Since it't returning only JSON and there is no html/css/js.
Since i planed to move this part to another domain for example:api.domain.com
Than i would make the visual part in Angular probably and it would use the api.domain.com