Browse files

Added the package.json and the example directory

  • Loading branch information...
1 parent d41c1d4 commit 9bf69ad4038f7a2874421f04354ac45906525817 David Coallier committed Oct 1, 2010
Showing with 55 additions and 0 deletions.
  1. +33 −0 example/README.md
  2. +22 −0 package.json
View
33 example/README.md
@@ -0,0 +1,33 @@
+Example
+=======
+
+Just start the server as such:
+
+ node server.js
+
+The code in server.js should look like:
+
+ var restlike = require('../lib/restlike');
+
+ http.creatServer(function (request, response) {
+ var restlike = new restlike.Restlike(request, response);
+
+ restlike.match('/my/road', {
+ // Handle the GET request
+ get: function() {
+ return {"name": "fun"};
+ },
+
+ // Handle the POST request
+ post: function() {
+ return ['posted'];
+ }
+ });
+
+ restlike.match('/your/road',{
+ // Handle the DELETE request.
+ delete: function() {
+ return [1,2,3,4,5];
+ }
+ });
+ }).listen(8080);
View
22 package.json
@@ -0,0 +1,22 @@
+{
+ "name": "node-restlike",
+ "author": "David Coallier",
+ "email": "david.coallier@gmail.com",
+ "dependencies": [],
+ "contributors": [],
+ "keywords": [
+ "rest",
+ "database",
+ "web",
+ "json",
+ ],
+ "mappings":{},
+ "overlay": {},
+ "githubName": "node-restlike",
+ "engines": {"node":">=0.1.94"},
+ "type": "zip",
+ "version": "0.1",
+ "location": "http://github.com/davidcoallier/node-restlike",
+ "license":"BSD"
+}
+

0 comments on commit 9bf69ad

Please sign in to comment.