sourcery - 構建JavaScript的RESTful API客戶端
Sourcery是一個框架,用于構建RESTful API 客戶端。它的思想源于ActiveResource 并行為幾乎相同的方式。它的速度極快,非常簡單易用。
var Resource = require('sourcery'); var Base = Resource.extend({ host: 'http://example.com/api/v1', // base host ext: 'json', // optional, will include `.json` in the URLs root: true, // optional, will include root element }); var Project = Base.extend({ path: '/projects', // http://example.com/api/v1/projects name: 'Project', // optional, this is the name for the root element });
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!