Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@kriszyp kriszyp authored
View
1  .gitignore
@@ -0,0 +1 @@
+node_modules
View
0  lib/app.js → app.js
File renamed without changes
View
0  lib/edit.js → edit.js
File renamed without changes
View
0  lib/facet/page-change.js → facet/page-change.js
File renamed without changes
View
0  lib/facet/page.js → facet/page.js
File renamed without changes
View
0  lib/index.js → index.js
File renamed without changes
View
5 lib/jsgi/redirect-root.js → jsgi/redirect-root.js
@@ -1,9 +1,12 @@
exports.RedirectRoot = function(Redirect, app){
- var redirector = Redirect("/Page/Example");
+// var redirector = Redirect("/Page/Example");
+var redirector = require("./redirect").Redirect("/Page/Example");
+exports.RedirectRoot = function(app){
return function(request){
if(request.pathInfo == "/"){
return redirector(request);
}
return app(request);
};
+};
};
View
29 jsgi/redirect.js
@@ -0,0 +1,29 @@
+var uri = require("url");
+
+exports.Redirect = function (path, status) {
+
+ status = status || 301;
+
+ return function (request) {
+ var location =
+ (request.scheme || "http") +
+ "://" +
+ (request.headers.host || (
+ request.host +
+ (request.port == 80 ? "" : ":" + request.port)
+ )) +
+ (request.scriptName || "") +
+ request.pathInfo;
+
+ location = path ? uri.resolve(location, path) : request.headers.referer;
+
+ return {
+ status: status,
+ headers: {
+ "location": location,
+ "content-type": "text/plain"
+ },
+ body: ['Go to <a href="' + location + '">' + location + "</a>"]
+ }
+ }
+}
View
0  lib/media/wiki-html.js → media/wiki-html.js
File renamed without changes
View
0  lib/model/page-change.js → model/page-change.js
File renamed without changes
View
0  lib/model/page-mongo.js → model/page-mongo.js
File renamed without changes
View
0  lib/model/page-sql.js → model/page-sql.js
File renamed without changes
View
0  lib/model/page.js → model/page.js
File renamed without changes
View
0  lib/monitor.js → monitor.js
File renamed without changes
View
9 package.json
@@ -1,7 +1,7 @@
{
"name": "persevere-example-wiki",
"author": "",
-
+ "version": "0.0.0",
"contributors": [],
"mappings":{
"perstore": "http://github.com/kriszyp/perstore/zipball/v0.2.4!/",
@@ -19,5 +19,12 @@
"jsgi-node": "jar:http://github.com/kriszyp/jsgi-node/zipball/v0.2.5!/lib/jsgi-node.js",
"multi-node": "http://github.com/kriszyp/multi-node/zipball/v0.2.2!/",
"tunguska": "http://github.com/kriszyp/tunguska/zipball/v0.2.3!/"
+ },
+ "dependencies": {
+ "pintura": ">=0.2.6",
+ "promised-io": ">=0.2.2",
+ "commonjs-utils": ">=0.2.2",
+ "multi-node": ">=0.2.3",
+ "transporter": ">=0.0.1"
}
}
View
0  lib/util/narwhal-compat.js → util/narwhal-compat.js
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.