Skip to content
This repository
Browse code

Merge branch 'package-fix' of git://github.com/neonstalwart/persevere…

…-example-wiki

Conflicts:
	jsgi/redirect-root.js
	package.json
  • Loading branch information...
commit c81433495235e1ee0df4126020eb2d78e83a236c 2 parents 6c1ebbb + 7f7a82e
Kris Zyp authored September 30, 2011
1  .gitignore
... ...
@@ -0,0 +1 @@
  1
+node_modules
0  lib/app.js → app.js
File renamed without changes
0  lib/edit.js → edit.js
File renamed without changes
0  lib/facet/page-change.js → facet/page-change.js
File renamed without changes
0  lib/facet/page.js → facet/page.js
File renamed without changes
0  lib/index.js → index.js
File renamed without changes
5  lib/jsgi/redirect-root.js → jsgi/redirect-root.js
... ...
@@ -1,9 +1,12 @@
1 1
 exports.RedirectRoot = function(Redirect, app){
2  
-	var redirector = Redirect("/Page/Example");
  2
+//	var redirector = Redirect("/Page/Example");
  3
+var redirector = require("./redirect").Redirect("/Page/Example");
  4
+exports.RedirectRoot = function(app){
3 5
 	return function(request){
4 6
 		if(request.pathInfo == "/"){
5 7
 			return redirector(request);
6 8
 		}
7 9
 		return app(request);
8 10
 	};
  11
+};
9 12
 };
29  jsgi/redirect.js
... ...
@@ -0,0 +1,29 @@
  1
+var uri = require("url");
  2
+
  3
+exports.Redirect = function (path, status) {
  4
+    
  5
+    status = status || 301;
  6
+    
  7
+    return function (request) {
  8
+        var location =
  9
+            (request.scheme || "http") +
  10
+            "://" +
  11
+            (request.headers.host || (
  12
+                request.host +
  13
+                (request.port == 80 ? "" : ":" + request.port)
  14
+            )) +
  15
+            (request.scriptName || "") +
  16
+            request.pathInfo;
  17
+        
  18
+        location = path ? uri.resolve(location, path) : request.headers.referer;
  19
+        
  20
+        return {
  21
+            status: status,
  22
+            headers: {
  23
+                "location": location,
  24
+                "content-type": "text/plain"
  25
+            },
  26
+            body: ['Go to <a href="' + location + '">' + location + "</a>"]
  27
+        }
  28
+    }
  29
+}
0  lib/media/wiki-html.js → media/wiki-html.js
File renamed without changes
0  lib/model/page-change.js → model/page-change.js
File renamed without changes
0  lib/model/page-mongo.js → model/page-mongo.js
File renamed without changes
0  lib/model/page-sql.js → model/page-sql.js
File renamed without changes
0  lib/model/page.js → model/page.js
File renamed without changes
0  lib/monitor.js → monitor.js
File renamed without changes
9  package.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
 	"name": "persevere-example-wiki",
3 3
 	"author": "",
4  
-	
  4
+	"version": "0.0.0",
5 5
 	"contributors": [],
6 6
 	"mappings":{
7 7
 		"perstore": "http://github.com/kriszyp/perstore/zipball/v0.2.4!/",
@@ -19,5 +19,12 @@
19 19
 		"jsgi-node": "jar:http://github.com/kriszyp/jsgi-node/zipball/v0.2.5!/lib/jsgi-node.js",
20 20
 		"multi-node": "http://github.com/kriszyp/multi-node/zipball/v0.2.2!/",
21 21
 		"tunguska": "http://github.com/kriszyp/tunguska/zipball/v0.2.3!/"
  22
+	},
  23
+	"dependencies": {
  24
+		"pintura": ">=0.2.6",
  25
+		"promised-io": ">=0.2.2",
  26
+		"commonjs-utils": ">=0.2.2",
  27
+		"multi-node": ">=0.2.3",
  28
+		"transporter": ">=0.0.1"
22 29
 	}
23 30
 }
0  lib/util/narwhal-compat.js → util/narwhal-compat.js
File renamed without changes

0 notes on commit c814334

Please sign in to comment.
Something went wrong with that request. Please try again.