public
Rubygem
Description: JSON Web App Framework
Homepage: http://halcyon.rubyforge.org/
Clone URL: git://github.com/mtodd/halcyon.git
Click here to lend your support to: halcyon and make a donation at www.pledgie.com !
halcyon / examples / weedb / README
100644 63 lines (37 sloc) 1.117 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
= WeeDB
 
The Halcyon clone of TinyDB (http://tinydb.org/).
 
 
== Introduction
 
This is a simple
 
 
== Installation & Setup
 
Install the dependencies listed below, set up the database, and run the
migrations.
 
=== Dependencies
 
* Halcyon (halcyon >= 0.5.0)
* Sequel (sequel >= 1.5.1)
 
=== Database
 
Set up a database, @weedb_development@ for example, and create a user,
@wee_user@ should work fine. Copy the @config/database.sample.yml@ file to
@config/database.yml@ and update the values to match the database name and user
set up.
 
Now, run the migrations:
 
  $ rake db:migrate
 
== Usage
 
=== Start The Server
 
  $ halcyon start -p 4647
 
=== Interacting With The Server
 
In Ruby:
 
  $ irb -r lib/client
  >> client = WeeDB::Client.new("http://localhost:4647/")
  >> client << {'foo' => 'bar'}
  => '1aB2'
  >> client['1aB2']
  => {'foo' => 'bar'}
 
Elsewhere:
 
  $ curl --data '' http://localhost:4647/?foo=bar
    {'status':200,'body':'2bC3'}
  $ curl http://localhost:4647/2bC3
    {'status':200,'body':{'foo':'bar'}}
 
== License
 
WeeDB is licensed under the MIT License.
 
== Contact
 
Matt Todd <chiology@gmail.com>