What is the difference between a regular Rails app and a Rails API?

前端 未结 3 516
时光取名叫无心
时光取名叫无心 2021-01-02 18:58

In the process of learning Rails, I read about how we could combine it with some front-end MV* JavaScript frameworks — such as Backbone.js, Angular.js, or Ember.js — to impr

3条回答
  •  -上瘾入骨i
    2021-01-02 19:35

    I found a pretty clear answer in Yoni Weisbrod's Rails API Mini Guide:

    The fundamental difference between an API and a regular Rails app is that an API returns data for further processing, rather than data that is meant to be viewed directly. Therefore, rather than producing an HTML document (with CSS and/or Javascript) that looks pretty, APIs produce simple information structures that can be further processed by whatever will be consuming our API.

提交回复
热议问题