1 REST JSONP server using mojolicious for <angular/>
4 <angular/>: Complex web apps made simple
8 mojolicious: the web in the box!
9 http://mojolicious.org/
12 This is my attempt to implement REST API described at:
14 http://docs.getangular.com/REST.Basic
16 using CouchDB HTTP view API
18 http://wiki.apache.org/couchdb/HTTP_view_API
20 to provide storage for experimenting with local datasets using angular $resource API.
21 You can also query CouchDB views $xhr("JSON", ...) in angular through angular-server.pl
24 At it's current stage it provides support for angular $resource get, query and $save
26 http://angularjs.org/Service:$resource
29 Data can also be serve static json files stored in:
31 public/json/:database/:entity/:key
33 which can be used to provide data using external stand-alone scripts.
37 Replication of data between instances using angular REST API can be done with:
39 # create local CouchDB database
40 curl -X PUT http://localhost:5984/test
42 ./angular-replicate.pl \
43 http://dpavlin.getangular.com/data/conference \
44 http://localhost:3000/data/test
46 Replication is currently good only for initial import of data since it doesn't
47 support incremental replication and dies if data is allready present.
55 Optionally build angular to get single file download
63 ./angular-server.pl daemon --reload
66 Angular examples available:
68 - template/Cookbook - examples from wiki working against github version of angular
69 - template/conferece - conference submission example using mojolicious REST API server
70 - public/app/conference - new application layout with latest example confernce submission
72 curl -X PUT http://localhost:5984/conference/_design/symposium \
73 -d @public/app/conference/_design/symposium
79 couchdb-changes.pl - simple _changes feed watcher using Mojo::Client documented at
81 http://wiki.apache.org/couchdb/HTTP_database_API#Changes
84 couchdb-trigger.pl - FSM document with hook for user-defiend triggers
86 trigger/shell.pm - execute shell commands
87 trigger/email.pm - skeleton for sending e-email
88 trigger/KinoSearch.pm - full-text search
90 $ curl -X PUT http://localhost:5984/trigger_demo
93 $ ./couchdb-trigger.pl http://localhost:5984/trigger_demo trigger/shell.pm
95 $ curl -X PUT http://localhost:5984/trigger_demo/t1 -d '{"trigger":{"command":"notify-send CouchDB t1"}}'
98 couchdb-external-kinosearch.pl - external searcher for KinoSearch indexes
99 (configuration for CouchDB is included at end of file)
101 $ ./couchdb-trigger.pl http://localhost:5984/trigger_demo trigger/KinoSearch.pm
103 $ curl -X PUT http://localhost:5984/trigger_demo/text -d '{"text":"foobar bla bla"}'
104 {"ok":true,"id":"text","rev":"1-cf9bb608f93af7f4e5e40656a6e50096"}
106 $ curl 'http://localhost:5984/trigger_demo/_kinosearch?include_docs=true;q=foobar'
112 + implement angular-server.pl which implements REST API supported by $resource in angular
113 + persistency to local CouchDB, and use views to query data
114 + implement CouchDB _changes and FSM inside document as base for queue or triggers