3 ms·
An AJAX api library where you specify types and RESTful actions and it builds an object with type-checked methods. The code looks like: var api = new AjaxAP
by dugmartin 17y ago
An AJAX api library where you specify types and RESTful actions and it builds an object with type-checked methods.
The code looks like:
var api = new AjaxAPI(
"page = /testapi.php \n" +
"mydate= (^\\d\\d-\\d\\d-\\d\\d\\d\\d$) \n" +
"int=(^\\d?+$) \n" +
"text = (^.+$) \n" +
"get_messages : GET /messages/project={int}/date={mydate}/ \n" +
"get_comments: GET /comments/project={int} \n" +
"save_comment:POST /save_comment?project={int}&comment={text} \n" +
"delete_comment :POST /delete_comment/project={int}?comment_id={int} \n" +
"echo: GET {page}?_method=echo&[foo={int}]&name={text}&[baz=(text)] \n");
api.call.get_messages({project: 12, comment_id: 21}, function (request, response) {...});
Its done and been sitting on my hard drive for 2-3 years.
- geuis 17y agoWhy not post that up somewhere. I want to take a look at this.