Why create a separate application for RESTful API?

前端 未结 3 1885
太阳男子
太阳男子 2021-02-09 05:17

In the guide for Yii 2 it is said:

While not required, it is recommended that you develop your RESTful APIs as a separate application, different from yo

3条回答
  •  旧巷少年郎
    2021-02-09 05:49

    IMHO if you need REST API for Angular.js or Knockout.js AJAX calls on your website it's an overhead to do it as a separate application. Because you will have issues with cross-domain AJAX calls (especially for POST requests).

    I think it's enough to make a module (API) in the frontend for REST API

提交回复
热议问题