== JSON Server App Framework
Halcyon is a JSON Web App Server Framework built on Rack for speed and
I’m very pleased to release a heap of improvements to the initial
public version of Halcyon, now version 0.3.18, a beta release
Also, stay tuned for release 0.4.0 which should occur in the next few
weeks, adding support for Analogger, daemonization and cluster
management, thorough testing, more examples, and some improvements to
Release Name: halcyon-0.3.18
Halcyon has gone through a great deal of improvement, including
supporting proper logging, extensive configuration file improvements
like config files. Halcyon is now releasing to the wild for public
testing version 0.3.18.
- Fixed many minor issues with dependencies and auto loading.
- Changed the base Halcyon exception to a StandardError to be
friendlier and conform to the ideal of standard, recoverable errors.
- The Client::Base’s request method now throws an exception instead of
simply returning a hash with the exception information.
- Added another example Client and Server to manage preferences.
- Fixed numerous issues with POST data with POST and PUT requests and
clarified the documentation on retreiving and handling POST contents.
- Made numerous improvements to handling unexpected input, issuing
warnings or aborting script execution where appropriate.
- Fixed dependency on JSON (opting for json/ext by default in the
libs, but failing gracefully to load json/pure, and requiring only
json_pure and offering warnings and suggestions to install json when
- Expanded the list of error codes available and refined the
constantization of the error code messages.
- Fixed problems with different (Rack) handlers not being consistent
with the data in REQUEST_URI.
- Setup some helpful data in @env such as halcyon.logger.
- Added proper Logging and PID files.
- Fixed minor issues with acceptable requests.
- Added signal trapping for graceful and clean exits; added signal
trap for SIGUSR1 to toggle debugging.
- Added warning for unacceptable requests.
NOTE: The JSON dependency is now recorded as the json_pure gem in the
Gem spec and will only automatically install that gem. To get faster
parsing and better performance, manually install the json gem with
“gem install json”. This was done to support platforms that wouldn’t
natively build the JSON extensions. Internally the JSON extensions are
given precedence, though it fails gracefully and will use the pure
Ruby JSON gem.
- Rack >= 0.2.0
- JSON >= 1.1.1
- Merb >= 0.4.0
Halcyon is built on top of Rack for swift delivery of very small
informational payloads transmitted through JSON. Merb routes are
employed to make designing app structures easier with routes.
= From the Readme
== Quick start
There’s not much to Halcyon. I’ve put a good deal of time into
fleshing out the RDocs so check out the documentation and the example
Halcyon is the sister project of Aurora SAS, a simple authentication
server to manage authentication, session management, and user roles
and permissions. It is still very early in development (as Halcyon was
a prerequisite) but there should be some interesting code from that
project to let you see just what Halcyon is capable. Stay tuned!
== Installing with RubyGems
A Gem of Halcyon is available. You can install it with:
$ sudo gem install halcyon
$ sudo gem install json
The halcyon command will assist you for running the server. Just run:
$ halcyon -d -p 3800 example/simple
You may need to cd into the project directory, or, alternatively, you
can cp the files out into your tmp folder and work from there. If
you’d like to just cd, +gem which halcyon+ will tell you where to find
the Gem directory.
Once you’ve gotten the server running, pull open your browser, point
it to localhost:3800/ and see what happens. Take a look at the source
and try to access the other routes and see how things work. Notice the
response in the browser.
Once you’ve familiarized yourself with that, kill the server (Ctl+C)
and start it again without the debugging switch: -d. (+halcyon -h+ for
$ halcyon -p 3800 example/simple
Now pull it up again in the browser. You’ll notice right away that it
blocks all access from any user agent that doesn’t meet its
requirements (but debug mode disabled that feature).
The good news about that is that it reduces a lot of the garbage
signals that a normal server might have to endure, but since we’re
working with specialized applications, it’s perfectly reasonable to be
very stingy about who we talk to.
Now, pull up IRB and require RubyGems and Halcyon (as halcon/client).
Now run the following:
s = Simple.new(‘http://localhost:3800’)
s.url_for(‘greet’, :name => ‘John’)
And that is some very simple stuff you can do with the Client library.
The Client library is meant to be used in larger applications where a
fraction of functionality requires smaller and faster updates or
quicker responses in a lightweight protocol, perfect for sending
authentication information (over secure channels, of course) or
getting updates on various monitoring sources.
Read more in the RDocs, there’s a lot more there to find out. The best
way to learn, though, is to play, and I like to play, so, go for it.
Please mail bugs, suggestions and patches to [email protected].
You are also welcome to join the #halcyon channel on irc.freenode.net.
Our website is up so stop by and check out what’s going down. Our
address is http://halcyon.rubyforge.org/. On there you will find
information about our mailing list as well, so do stop by.
== License and Copyright
Copyright © 2007 Matt T. <purl.org/net/maraby>.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.