Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renamed var.

  • Loading branch information...
commit 418c16391764a266e1a65c792d24a4ff0bafc6e6 1 parent 73f2b1c
@joshbuddy authored
Showing with 6 additions and 7 deletions.
  1. +1 −1  README.rdoc
  2. +4 −5 exmaples/node-example.js
  3. +1 −1  lib/sherpa.js
View
2  README.rdoc
@@ -135,7 +135,7 @@ To use this within Node.js, simply use the Node.js interface. Here is a simple e
}},
'/hello/:name': {to: function (request, response) {
response.sendHeader(200, {"Content-Type": "text/plain"});
- response.sendBody("Hello "+request.sherpa_response.params['name']+"\n");
+ response.sendBody("Hello "+request.sherpaResponse.params['name']+"\n");
response.finish();
}},
'not found': {to: function (request, response) {
View
9 exmaples/node-example.js
@@ -1,7 +1,8 @@
require('../lib/sherpa')
var sys = require("sys"), http = require("http");
-var sherpa = new Sherpa.interfaces.NodeJs({
+
+http.createServer(new Sherpa.interfaces.NodeJs({
'/hello': {to: function (request, response) {
response.sendHeader(200, {"Content-Type": "text/plain"});
response.sendBody("Hello World\n");
@@ -9,7 +10,7 @@ var sherpa = new Sherpa.interfaces.NodeJs({
}},
'/hello/:name': {to: function (request, response) {
response.sendHeader(200, {"Content-Type": "text/plain"});
- response.sendBody("Hello "+request.sherpa_response.params['name']+"\n");
+ response.sendBody("Hello "+request.sherpaResponse.params['name']+"\n");
response.finish();
}},
'not found': {to: function (request, response) {
@@ -18,9 +19,7 @@ var sherpa = new Sherpa.interfaces.NodeJs({
response.finish();
}}
-});
-
-http.createServer(sherpa.listener()).listen(8000);
+}).listener()).listen(8000);
sys.puts("Server running at http://127.0.0.1:8000/");
View
2  lib/sherpa.js
@@ -335,7 +335,7 @@ Sherpa.interfaces.NodeJs.prototype = {
return function(httpRequest, httpResponse) {
var response = router.recognize(httpRequest.uri.path, httpRequest);
if (response) {
- httpRequest.sherpa_response = response;
+ httpRequest.sherpaResponse = response;
response.destination(httpRequest, httpResponse);
} else {
notFound(httpRequest, httpResponse);
Please sign in to comment.
Something went wrong with that request. Please try again.