X-Git-Url: http://git.rot13.org/?p=angular-mojolicious.git;a=blobdiff_plain;f=README;h=45493f5e3833ccb0370d6edb857bf2ed764f0a44;hp=d6287ffa9a6b9574b628db3165013db10ee935d0;hb=0a7d16d6f790f3faa31309fb4d1e778f076c03b2;hpb=e5a5e3c2223e6473679b57c7132e178ea0113dcf diff --git a/README b/README index d6287ff..45493f5 100644 --- a/README +++ b/README @@ -13,8 +13,30 @@ This is my attempt to implement REST API described at: http://docs.getangular.com/REST.Basic -using simple in-memory model for experimenting with local datasets using - +using CouchDB HTTP view API + +http://wiki.apache.org/couchdb/HTTP_view_API + +to provide storage for experimenting with local datasets using angular $resource API. +You can also query CouchDB views $xhr("JSON", ...) in angular through angular-server.pl + + +At it's current stage it provides support for angular $resource get, query and $save + +http://angularjs.org/Service:$resource + + +Replication of data between instances using angular REST API can be done with: + + # create local CouchDB database + curl -X PUT http://localhost:5984/test + + ./angular-replicate.pl \ + http://dpavlin.getangular.com/data/conference \ + http://localhost:3000/data/test + +Replication is currently good only for initial import of data since it doesn't +support incremental replication and dies if data is allready present. Installation: @@ -32,3 +54,51 @@ Start it with: ./angular-server.pl daemon --reload + +Angular examples available: + +- template/Cookbook - examples from wiki working against github version of angular +- template/conferece - conference submission example using mojolicious REST API server +- public/app/conference - new application layout with latest example confernce submission + + curl -X PUT http://localhost:5984/conference/_design/symposium \ + -d @public/app/conference/_design/symposium + + + +CouchDB examples: + + couchdb-changes.pl - simple _changes feed watcher using Mojo::Client documented at + + http://wiki.apache.org/couchdb/HTTP_database_API#Changes + + + couchdb-trigger.pl - FSM document with hook for user-defiend triggers + + trigger/shell.pm - execute shell commands + trigger/email.pm - skeleton for sending e-email + trigger/KinoSearch.pm - full-text search + + $ curl -X PUT http://localhost:5984/trigger_demo + {"ok":true} + + $ ./couchdb-trigger.pl http://localhost:5984/trigger_demo trigger/shell.pm + + $ curl -X PUT http://localhost:5984/trigger_demo/t1 -d '{"trigger":{"command":"notify-send CouchDB t1"}}' + + + couchdb-external-kinosearch.pl - external searcher for KinoSearch indexes + (configuration for CouchDB is included at end of file) + + $ ./couchdb-trigger.pl http://localhost:5984/trigger_demo trigger/KinoSearch.pm + + $ curl 'http://localhost:5984/trigger_demo/_kinosearch?include_docs=true;q=foobar' + + + +Roadmap: + ++ implement angular-server.pl which implements REST API supported by $resource in angular ++ persistency to local CouchDB, and use views to query data ++ implement CouchDB _changes and FSM inside document as base for queue or triggers +- tests