Created
November 6, 2012 08:13
-
-
Save 5509/4023430 to your computer and use it in GitHub Desktop.
Backbone.jsにあわせたAPI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET: /api/entries (一覧取得 - collectionのfetchで取得する、JSONを取得 | |
POST: /api/entries (新規作成 - collectionのcreateで作成する、JSONを取得 | |
GET: /api/entries/:entry_id (エントリ取得 - modelのfetchで取得する、JSONを取得 | |
PUT: /api/entries/:entry_id (エントリ更新 - modelのsaveで保存する、200を期待 | |
DELETE: /api/entries/:entry_id (エントリ削除 - modelのdestroyで削除してcollectionからの削除される、200を期待 | |
modelのJSON | |
{ | |
id: 1, | |
// あとは適当 | |
} | |
collectionのJSON | |
[ | |
{ id: 1, ... }, | |
{ id: 2, ... }, | |
{ id: 3, ... }, | |
... | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment