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/demo
43 $ ./angular-replicate.pl \
44 http://dpavlin.getangular.com/data/conference \
45 http://localhost:3000/data/demo
47 Replication is currently good only for initial import of data since it doesn't
48 support incremental replication and dies if data is allready present.
54 $ git submodule update
56 Optionally build angular to get single file download
64 $ ./angular-server.pl daemon --reload
67 Angular examples available:
69 - template/Cookbook - examples from wiki working against github version of angular
70 - template/conferece - conference submission example using mojolicious REST API server
71 - public/app/conference - new application layout with latest example confernce submission
73 $ curl -X PUT http://localhost:5984/conference/_design/symposium \
74 -d @public/app/conference/_design/symposium
80 couchdb-changes.pl - simple _changes feed watcher using Mojo::Client documented at
82 http://wiki.apache.org/couchdb/HTTP_database_API#Changes
85 couchdb-trigger.pl - FSM document with hook for user-defiend triggers
87 trigger/shell.pm - execute shell commands
88 trigger/email.pm - skeleton for sending e-email
89 trigger/KinoSearch.pm - full-text search
91 $ curl -X PUT http://localhost:5984/demo
94 $ ./couchdb-trigger.pl http://localhost:5984/demo trigger/shell.pm
96 $ curl -X PUT http://localhost:5984/demo/t1 -d '{"trigger":{"command":"notify-send CouchDB t1"}}'
99 couchdb-external-kinosearch.pl - external searcher for KinoSearch indexes
100 (configuration for CouchDB is included at end of file)
102 $ ./couchdb-trigger.pl http://localhost:5984/demo trigger/KinoSearch.pm
104 $ curl -X PUT http://localhost:5984/demo/text -d '{"text":"foobar bla bla"}'
105 {"ok":true,"id":"text","rev":"1-cf9bb608f93af7f4e5e40656a6e50096"}
107 $ curl 'http://localhost:5984/demo/_kinosearch?include_docs=true;q=foobar'
113 + implement angular-server.pl which implements REST API supported by $resource in angular
114 + persistency to local CouchDB, and use views to query data
115 + implement CouchDB _changes and FSM inside document as base for queue or triggers